_ Neverwinter Nights Aurora Toolset _

: Lex Mar 27 2004, 22:00

.
, .

:

-- 1 --

* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=42
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=66
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=82
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=764
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=1227
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=1653
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=1833
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=1972
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=2291
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=3216
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=3599
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=5772
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=5811* http://www.wrg.ru/forums/index.php?s=&showtopic=5&view=findpost&p=5833
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=6133
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=6571
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=6707
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=7958
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=8406

-- 2 --

*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=8620
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=8736
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=9892
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=9967
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=12810
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=13388
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=13557
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=13562
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=15164
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=16035
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=16055
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=16340
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=16468
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=16487
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=16837
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=17402
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=17576
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=24059
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=24073
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=30675
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31337
*http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31367

-- 3 --

* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31599
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31610
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31616
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31671
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31684
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31689
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31691
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31694
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31698
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31700
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31702
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31704
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31706
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31708
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31710
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31712
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31714
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=31716
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=32649
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=33153
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=37456
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=43312
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=44889
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=44977
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=47644

-- 4 --
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=47751
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=49250
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=51168
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=55597
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=56638
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=57679
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=58841
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=59145
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=62052
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=68679
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=76917
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=79397
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=79452
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=79471
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=80131
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=81330
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=84401
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=89000
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=90112
* http://www.city-of-masters.ru/forums/index.php?s=&showtopic=5&view=findpost&p=94460




: Tarre T. Apr 2 2004, 15:08

, . : "blood"- .
, , smile.gif
:

Neverwinter Script Source
#include "damage_system"
void main()
{
BloodEffect();
Talking();
}
.
.................................................
c :
..................................................
Neverwinter Script Source
location RandomLocation(object oTarget, float fRadius, int iLine = TRUE)
{
if(!iLine)
fRadius=IntToFloat(Random(FloatToInt(fRadius)));
float iXO=VectorMagnitude(GetPosition(oTarget))*cos(VectorToAngle(GetPosition(oTarget)));
float iYO=VectorMagnitude(GetPosition(oTarget))*sin(VectorToAngle(GetPosition(oTarget)));
float fRndomAngle=IntToFloat(Random(360));
location lNewLoc=Location(GetArea(oTarget),Vector(iXO+fRadius*cos(fRndomAngle), iYO+fRadius*sin(fRndomAngle)), 360.0);
return lNewLoc;}

void BloodEffect()
{
location lRandom1 = RandomLocation(OBJECT_SELF, 4.4, TRUE);
location lRandom2 = RandomLocation(OBJECT_SELF, 3.5, TRUE);
location lRandom3 = RandomLocation(OBJECT_SELF, 1.9, TRUE);
location lOS = GetLocation(OBJECT_SELF);
int iChL;
int iChM;
int iChS;
int iBS;
if (GetRacialType(OBJECT_SELF)==RACIAL_TYPE_HALFORC||
RACIAL_TYPE_HUMANOID_ORC||
RACIAL_TYPE_ABERRATION)
{
iChL = 99;
iChM = 49;
iChS = 19;
iBS = 9;}
else if (GetRacialType(OBJECT_SELF)==RACIAL_TYPE_HUMAN||
RACIAL_TYPE_GNOME||
RACIAL_TYPE_HALFELF)
{
iChL = 131;
iChM = 46;
iChS = 17;
iBS = 6;}
else if (GetRacialType(OBJECT_SELF)==RACIAL_TYPE_ELF||
RACIAL_TYPE_FEY||
RACIAL_TYPE_HALFLING||
RACIAL_TYPE_DWARF)
{
iChL = 9999;
iChM = 43;
iChS = 11;
iBS = 5;}
else
{
iChL = 99;
iChM = 49;
iChS = 19;
iBS = 9;
}
if (GetTotalDamageDealt()>iChL)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE), OBJECT_SELF);
CreateObject(OBJECT_TYPE_PLACEABLE, "blood", lRandom1);
}
if (GetTotalDamageDealt()>iChM)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_RED_MEDIUM), OBJECT_SELF);
CreateObject(OBJECT_TYPE_PLACEABLE, "blood", lRandom2);
}
if (GetTotalDamageDealt()>iChS)
{
switch (Random(2))
{
case 1:
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL), OBJECT_SELF);break;
}
case 2:
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_SPARK_MEDIUM), OBJECT_SELF);
break;
}
}
CreateObject(OBJECT_TYPE_PLACEABLE, "blood", lRandom3);
}
if (GetTotalDamageDealt()>iBS)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL), OBJECT_SELF);
}
}

void Talking()
{
string iP;
string sYa = GetName(GetObjectByTag("ax_letter_ya"));
if (GetAlignmentGoodEvil(OBJECT_SELF)==ALIGNMENT_EVIL)
{
switch(Random(6))
{
case 1: iP = " !"; break;
case 2: iP = " z, !"; break;
case 3: iP = "! !Z z !"; break;
case 4: iP = ", !"; break;
case 5: iP = "! !!"; break;
case 6: iP = ", , !"; break;
}
}
else if (GetAlignmentGoodEvil(OBJECT_SELF)==ALIGNMENT_GOOD)
{
switch(Random(6))
{
case 1: iP = "! !"; break;
case 2: iP = " z !"; break;
case 3: iP = "z !"; break;
case 4: iP = "! ! , !"; break;
case 5: iP = "! z ! z ! "; break;
case 6: iP = ", , !"; break;
}
}
if (GetAlignmentLawChaos(OBJECT_SELF)==ALIGNMENT_LAWFUL)
{
switch(Random(6))
{
case 1: iP = "! !"; break;
case 2: iP = " ! !"; break;
case 3: iP = "! !Z z !"; break;
case 4: iP = "! !"; break;
case 5: iP = "! !!"; break;
case 6: iP = ", , ! ?!"; break;
}
}
else if (GetAlignmentLawChaos(OBJECT_SELF)==ALIGNMENT_CHAOTIC)
{
switch(Random(6))
{
case 1: iP = " !"; break;
case 2: iP = " z"; break;
case 3: iP = "! !Z z !"; break;
case 4: iP = "! !"; break;
case 5: iP = "! !!"; break;
case 6: iP = ", , !"; break;
}
}
else if (GetAlignmentLawChaos(OBJECT_SELF)==ALIGNMENT_NEUTRAL)
{
switch (Random(6))
{
case 1: iP = "! !"; break;
case 2: iP = " z"; break;
case 3: iP = "! !Z z !"; break;
case 4: iP = " ! z !"; break;
case 5: iP = ", !!"; break;
case 6: iP = ", , z !!"; break;
}
}
switch (Random(2))
{
case 0: SpeakString(iP);break;
case 1: SpeakString(iP);break;
case 2: break;
}}

: Bot Apr 3 2004, 16:37

, ..
Lex: RandomLocation - .
. smile.gif , . . , . - , - . (-10) - .

Neverwinter Script Source
void bleed(int iBleedAmt)
{
    effect eBleedEff;
    if (GetCurrentHitPoints() <= 0) {
        if (iBleedAmt > 0) {
            eBleedEff = EffectDamage(iBleedAmt);
        } else {
            eBleedEff = EffectDamage(iBleedAmt);
        }
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eBleedEff, OBJECT_SELF);
        if (GetCurrentHitPoints() <= -10) {
            PlayVoiceChat(VOICE_CHAT_DEATH);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), OBJECT_SELF);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF);
            return;
        }

        if (iBleedAmt > 0) {
            if (d10(1) == 1) {
                iBleedAmt = -iBleedAmt;
                PlayVoiceChat(VOICE_CHAT_LAUGH);
            } else {
                switch (d6()) {
                    case 1: PlayVoiceChat(VOICE_CHAT_PAIN1); break;
                    case 2: PlayVoiceChat(VOICE_CHAT_PAIN2); break;
                    case 3: PlayVoiceChat(VOICE_CHAT_PAIN3); break;
                    case 4: PlayVoiceChat(VOICE_CHAT_HEALME); break;
                    case 5: PlayVoiceChat(VOICE_CHAT_NEARDEATH); break;
                    case 6: PlayVoiceChat(VOICE_CHAT_HELP);
                }
            }
        }
        DelayCommand(6.0,bleed(iBleedAmt));
    }
}
void main()
{
    object oDying = GetLastPlayerDying();
    AssignCommand(oDying, ClearAllActions());
    AssignCommand(oDying, bleed(1));
    CreateObject(OBJECT_TYPE_CREATURE, "blood", GetLocation(oDying));
}


'blood' - .

: NSS. .

: Aiwan Apr 4 2004, 19:31

, . OnFailToOpen . , WP_DOOR_TXT. . , .

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright © 2004 WRG!
//:: OnFailToOpen
//:://////////////////////////////////////////////
/*
  WP_DOOR_TXT - .
     .
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 10.01.2004
//:://////////////////////////////////////////////
void main()
{
object oWp = GetNearestObjectByTag("WP_DOOR_TXT"); //
string sDoor = GetName(oWp);

    if (GetIsObjectValid(oWp) && GetDistanceBetween(oWp, OBJECT_SELF) <= 10.0f)
        //  WP 10
        {
        SpeakString(sDoor); //
         return;
        }
        else
           {
           SpeakString("! WP_DOOR_TXT!");//
           return;
           }
}

: Aiwan Apr 23 2004, 08:12

, -. :cruel: OnAreaTransitionClick . biggrin.gif

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright © 2004 WRG!  [URL=http://wrg.ru]http://wrg.ru[/URL]
//:: am_oa_stop
//:://////////////////////////////////////////////
/*
    
        
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan    Aiwan@e-mail.ru
//:: Created On: 21.04.2004
//:://////////////////////////////////////////////
void main()
{
  object oPC = GetEnteringObject();
  object oAnimal = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
  object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
  object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
  object oHenchman = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oPC);
  object oSummoned = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
  object oJamp = GetTransitionTarget(OBJECT_SELF);

  if (GetIsPC(oPC))
  {
  AssignCommand(oPC, JumpToObject(oJamp));
  AssignCommand(oAnimal, JumpToObject(oJamp));
  AssignCommand(oDominated, JumpToObject(oJamp));
  AssignCommand(oFamiliar, JumpToObject(oJamp));
  AssignCommand(oHenchman, JumpToObject(oJamp));
  AssignCommand(oSummoned, JumpToObject(oJamp));
  }
}

: Baal May 4 2004, 13:28

Neverwinter Script Source
float GetX(location lTarget)
{
return GetPositionFromLocation(lTarget).x;
}

float GetY(location lTarget)
{
return GetPositionFromLocation(lTarget).y;
}

float GetZ(location lTarget)
{
return GetPositionFromLocation(lTarget).z;
}

// lWizLoc -
// lSpelLoc -
// nCount - -
// fSpellTime -
void IceWallSpell(location lWizLoc, location lSpelLoc, int nCount, float fSpellTime)
{
vector vAB = GetPositionFromLocation(lSpelLoc) - GetPositionFromLocation(lWizLoc);
vAB = Vector(vAB.x,vAB.y);
float fAlfa = VectorToAngle(vAB);
float fAB = VectorMagnitude(vAB);
float fBC = 0.0;
float fX1, fX2, fY1, fY2;
location lLoc1, lLoc2;
object oPlaceable1, oPlaceable2;
string sVR;
int bTrueFalse = TRUE;
///
string sResRef1 = "plc_box2";
string sResRef2 = "plc_box3";
/// ( )
float fSize = 1.1;
nCount--;
while(nCount >= 0)
{
fBC = fSize*nCount/2;
fX1 = GetX(lWizLoc) + fAB*cos(fAlfa) + fBC*sin(fAlfa);
fX2 = GetX(lWizLoc) + fAB*cos(fAlfa) - fBC*sin(fAlfa);
fY1 = GetY(lWizLoc) + fAB*sin(fAlfa) - fBC*cos(fAlfa);
fY2 = GetY(lWizLoc) + fAB*sin(fAlfa) + fBC*cos(fAlfa);
  sVR = (bTrueFalse) ? sResRef1 : sResRef2;
  bTrueFalse = !bTrueFalse;
///
lLoc1 = Location(GetAreaFromLocation(lWizLoc), Vector(fX1, fY1, GetZ(lSpelLoc)), fAlfa);
oPlaceable1 = CreateObject(OBJECT_TYPE_PLACEABLE, sVR, lLoc1);
AssignCommand(oPlaceable1, DelayCommand(fSpellTime, DestroyObject(OBJECT_SELF)));
if(nCount !=0)
{
///
lLoc2 = Location(GetAreaFromLocation(lWizLoc), Vector(fX2, fY2, GetZ(lSpelLoc)), fAlfa);
oPlaceable2 = CreateObject(OBJECT_TYPE_PLACEABLE, sVR, lLoc2);
AssignCommand(oPlaceable2, DelayCommand(fSpellTime, DestroyObject(OBJECT_SELF)));
}
nCount = nCount - 2;
}
return;
}


, . ( ) . smile.gif .

: Lord of V@MPIRES May 8 2004, 15:57

- ? ! . , ... ... - -.
-:

Neverwinter Script Source
void GiveSubRaceCWeaponL(string sSubRaceWeapon, object oPC)
{
    object oPC = GetEnteringObject();
    object oRacialWeapon = CreateItemOnObject(sSubRaceWeapon, oPC);
    AssignCommand(oPC, ActionEquipItem(oRacialWeapon, INVENTORY_SLOT_CWEAPON_R));
}

string SR_SubRace(object oPC)
{
    if (GetIsPC(oPC)) {
        object oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oPC);
        if (GetIsObjectValid(oItem))
        string sSubRace = GetSubRace(oPC);
        string sSRItem = "None";
        int iRace = GetRacialType(oPC);
        if (iRace == RACIAL_TYPE_DWARF) {
            if (sSubRace == "Gold Dwarf") {
                sSRItem = "golddwarfsubitem";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Gray Dwarf") {
                sSRItem = "graydwarfsubitem";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Shield Dwarf")
                return sSRItem;
        } // Dwarf
        if (iRace == RACIAL_TYPE_ELF) {
            if (sSubRace == "Moon Elf")
                return sSRItem;
            if (sSubRace == "Sun Elf") {
                sSRItem = "sunelfsubitem";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Wild Elf") {
                sSRItem = "wildelfsubitem";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Wood Elf") {
                sSRItem = "woodelfsubitem";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Drow Elf") {
                sSRItem = "drowsubitem";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
        } // Elf
        if (iRace == RACIAL_TYPE_HALFLING) {
            if (sSubRace == "Strongheart Halfling") {
                sSRItem = "";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Ghostwise Halfling") {
                sSRItem = "";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Lightfoot Halfling")
                return sSRItem;
        } // Halfling
        if (iRace == RACIAL_TYPE_GNOME) {
            if (sSubRace == "Deep Gnome") {
                sSRItem = "deepgnomesubitem";
                GiveSubRaceCWeaponL(sSRItem, oPC);
                return sSRItem;
            }
            if (sSubRace == "Rock Gnome")
                return sSRItem;
        } // Gnome
     }
    return "None";
}


, onClientEnter :
Neverwinter Script Source
#include "subrace"
void main()
{
    object oPC = GetEnteringObject();
    AddJournalQuestEntry("sub",0001, oPC);
    string sSubItem = SR_SubRace(oPC);
    if (sSubItem != "None")
    {
    SendMessageToPC(oPC, " - " + GetSubRace(oPC));
    }
}


- , , , .. , ! - ( , ):
+2 , -1 -1 .
, , - .

: Aiwan May 8 2004, 22:02

. , , . blum3.gif

, OnUnlocked OnDisarm .

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright © 2004 WRG!  www.wrg.ru
//:://////////////////////////////////////////////
/*
    -
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan    Aiwan@e-mail.ru
//:: Created On: 09.05.2004
//:://////////////////////////////////////////////

#include "nw_i0_tool"
void main()
{
//================ ================
object oUnlocked = GetLastUnlocked();
if (!GetLocalInt(OBJECT_SELF, "UNLOCKED"))
{
   if (GetIsPC(oUnlocked))
    {
    SetLocalInt(OBJECT_SELF, "UNLOCKED", TRUE);
    GiveXPToCreature(oUnlocked, 100);
    return;
    }
    else
    RewardPartyXP(10, GetFirstPC());
}
//=============== ============
      object oDisarmed = GetLastDisarmed();
      if (!GetLocalInt(OBJECT_SELF, "DISARMED"))
        {
        if (GetIsPC(oDisarmed))
          {
          SetLocalInt(OBJECT_SELF, "DISARMED", TRUE);
          GiveXPToCreature(oDisarmed, 100);
          return;
          }
          else
          RewardPartyXP(10, GetFirstPC());
       }
}

: Aiwan May 9 2004, 12:13

, .
LEX:, . . .
! good.gif

Neverwinter Script Source
#include "nw_i0_tool"
void main()
{
int iL = GetLockUnlockDC(OBJECT_SELF);
int iT = GetTrapDisarmDC(OBJECT_SELF);
object oDisarmed = GetLastDisarmed();
object oUnlocked = GetLastUnlocked();

//================ ================
if ((!GetLocalInt(OBJECT_SELF, "UNLOCKED"))&&(GetIsObjectValid(oUnlocked)))
   {
   SetLocalInt(OBJECT_SELF, "UNLOCKED", TRUE);
   if (HasItem(oUnlocked,GetLockKeyTag(OBJECT_SELF))) return;
   if (GetIsPC(oUnlocked)) //
    {
    GiveXPToCreature(oUnlocked, (iL * GetHitDice(oUnlocked)/3));
    // XP = DC 1/3
    return;
    }
   else // Henchman
    RewardPartyXP((iL*2), GetMaster(oUnlocked));
    // XP = DC 2
   return;
   }
//=============== ============
if ((!GetLocalInt(OBJECT_SELF, "DISARMED"))&&(GetIsObjectValid(oDisarmed)))
   {
   SetLocalInt(OBJECT_SELF, "DISARMED", TRUE);
   if (HasItem(oDisarmed,GetTrapKeyTag(OBJECT_SELF))) return;
   if (GetIsPC(oDisarmed)) //
    {
    GiveXPToCreature(oDisarmed, (iT * GetHitDice(oDisarmed)/3));
    // XP = DC 1/3
    return;
    }
   else // Henchman
    RewardPartyXP((iT*2), GetMaster(oDisarmed));
    // XP = DC 2
   }
}

: Aiwan May 10 2004, 20:53

.... smile.gif

: Tarre Talliorne May 13 2004, 15:27

. +1 , , , 35. :

Neverwinter Script Source
int XdY(int nX, int nY)
{
int iN=0;
int iResult=0;
    while (iN<nX)
    {
    iResult=iResult+Random(nY)+1;
    iN++;
    }
return iResult;
}

<small> 15:30</small>
:
Neverwinter Script Source
// get the total from rolling [1]- [nX*Random(xY)+1]
// scripted by TARRE T.
int XdY(int nX, int nY);

: Aiwan May 23 2004, 09:13

, , OnHeartbeat .

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright © 2004 WRG!  www.wrg.ru
//:: Name: am_doorlock_d_n
//:://////////////////////////////////////////////
/*
          
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan    Aiwan@e-mail.ru
//:: Created On: 21.05.2004
//:://////////////////////////////////////////////
void main()
{
if((GetIsNight() && GetLocked(OBJECT_SELF))||(GetIsDay() && !GetLocked(OBJECT_SELF)))
      {
      return;
      }
    if (GetIsNight())
        {
        SetLocked(OBJECT_SELF, TRUE);
        return;
        }
      if (GetIsDay())
           {
           SetLocked(OBJECT_SELF, FALSE);
           return;
           }
}

: DBColl May 23 2004, 10:59

.

//:://////////////////////////////////////////////
//:: Copyright (c) 2004 WRG! www.wrg.ru
//:: Name: am_doorlock_d_n
//:://////////////////////////////////////////////
/*

*/
//:://////////////////////////////////////////////
//:: Created By: Aiwan Aiwan@e-mail.ru
//:: Created On: 21.05.2004
//:://////////////////////////////////////////////
void main()
{
  if (GetArea(OBJECT_SELF) != GetArea(GetFirstPC())) //
       return;  // PS. !!!
// if((GetIsNight() && GetLocked(OBJECT_SELF))||(GetIsDay() && !GetLocked(OBJECT_SELF)))
// {
// return;   // [b] 4- , "" !
// }         // .[/b]
if (GetIsNight())
{
SetLocked(OBJECT_SELF, TRUE);
return;
}
if (GetIsDay())
{
SetLocked(OBJECT_SELF, FALSE);
return;
}
}

: Sir_Sarles May 26 2004, 08:21



. , ,
.


, . ? -
10 . smile.gif , .

Neverwinter Script Source
void main()
{
int iL = GetLockUnlockDC(OBJECT_SELF);
object oUnlocked = GetLastUnlocked();
int iDice;

if GetHitDice(oUnlocked) < 15
  {
  iDice = 15 - GetHitDice(oUnlocked);
  }
else
  {
  iDice = 1;
  }


//================ ================
if (!GetLocalInt(OBJECT_SELF, "UNLOCKED"))
{
  SetLocalInt(OBJECT_SELF, "UNLOCKED", TRUE);
  if (GetIsPC(oUnlocked)) //
  {
//  GiveXPToCreature(oUnlocked, (iL * GetHitDice(oUnlocked)/3));
  GiveXPToCreature(oUnlocked, (iL * iDice/3));
  return;
  }
  else // Henchman
  // RewardPartyXP((iL*2), GetMaster(oUnlocked));
  GiveXPToCreature(oUnlocked, 10);
}

}


------
, !
? wink3.gif ( Jagged Alliance,
1 100, . smile.gif ) Hostile?

: Tarre Talliorne May 27 2004, 19:18

( , , , , , - ). ( 7 - ) , .

1. , oWeapon. -, ( () ).

Neverwinter Script Source
int GetIsWeapon(object oWeapon)
{
    int iType = GetBaseItemType(oWeapon);
    if (GetIsObjectValid(oWeapon)&&iType!=BASE_ITEM_INVALID)
    {
        if (iType == BASE_ITEM_BASTARDSWORD ||
            iType == BASE_ITEM_BATTLEAXE ||
            iType == BASE_ITEM_CLUB ||
            iType == BASE_ITEM_DAGGER ||
            iType == BASE_ITEM_DART ||
            iType == BASE_ITEM_DIREMACE ||
            iType == BASE_ITEM_DOUBLEAXE ||
            iType == BASE_ITEM_GREATAXE ||
            iType == BASE_ITEM_GREATSWORD ||
            iType == BASE_ITEM_HALBERD ||
            iType == BASE_ITEM_HANDAXE ||
            iType == BASE_ITEM_HEAVYCROSSBOW ||
            iType == BASE_ITEM_HEAVYFLAIL ||
            iType == BASE_ITEM_KAMA ||
            iType == BASE_ITEM_KATANA ||
            iType == BASE_ITEM_KUKRI ||
            iType == BASE_ITEM_LIGHTFLAIL ||
            iType == BASE_ITEM_LIGHTHAMMER ||
            iType == BASE_ITEM_LIGHTMACE ||
            iType == BASE_ITEM_LONGBOW ||
            iType == BASE_ITEM_LONGSWORD ||
            iType == BASE_ITEM_MAGICSTAFF ||
            iType == BASE_ITEM_MORNINGSTAR ||
            iType == BASE_ITEM_QUARTERSTAFF ||
            iType == BASE_ITEM_RAPIER ||
            iType == BASE_ITEM_SCIMITAR ||
            iType == BASE_ITEM_SCYTHE ||
            iType == BASE_ITEM_SHORTBOW ||
            iType == BASE_ITEM_SHORTSPEAR ||
            iType == BASE_ITEM_SHORTSWORD ||
            iType == BASE_ITEM_SHURIKEN ||
            iType == BASE_ITEM_SICKLE ||
            iType == BASE_ITEM_SLING ||
            iType == BASE_ITEM_THROWINGAXE ||
            iType == BASE_ITEM_TORCH ||
            iType == BASE_ITEM_TWOBLADEDSWORD ||
            iType == BASE_ITEM_WARHAMMER
            )
        {
            return TRUE;
        }
    }
}


2. oObject(=OBJECT_SELF) .

Neverwinter Script Source
int GetIsCaster(object oObject=OBJECT_SELF)
{
    if((GetLevelByClass(CLASS_TYPE_BARD, oObject)||
        GetLevelByClass(CLASS_TYPE_CLERIC, oObject)||
        GetLevelByClass(CLASS_TYPE_DRUID, oObject)||
        GetLevelByClass(CLASS_TYPE_PALADIN, oObject)> 4||
        GetLevelByClass(CLASS_TYPE_RANGER, oObject)> 4||
        GetLevelByClass(CLASS_TYPE_SORCERER, oObject)||
        GetLevelByClass(CLASS_TYPE_WIZARD, oObject))&&
        GetObjectType(oObject)==OBJECT_TYPE_CREATURE)
    {
        return TRUE;
    }
}


3. -, . 2. 4.

Neverwinter Script Source
object GetNearestEnemyCaster(int iMaxLvl=20, int iMinLvl=1, object oObject=OBJECT_SELF)
{
    int i = 1;
    object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oObject, i++, CREATURE_TYPE_IS_ALIVE, TRUE);
    while (GetIsObjectValid(oCreature))
    {
        if (GetIsCaster(oCreature)&&
            GetPCLevel(oCreature)>=iMinLvl&&
            GetPCLevel(oCreature)<=iMaxLvl)
        {
            break;
        }
        oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oObject, i++, CREATURE_TYPE_IS_ALIVE, TRUE);
    }
    return oCreature;
}


4. . 3.

Neverwinter Script Source
object GetNearestFriedlyCaster(int iMaxLvl=20, int iMinLvl=1, object oObject=OBJECT_SELF)
{
    int i = 1;
    object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, oObject, i++, CREATURE_TYPE_IS_ALIVE, TRUE);
    while (GetIsObjectValid(oCreature))
    {
        if (GetIsCaster(oCreature)&&
            GetPCLevel(oCreature)>=iMinLvl&&
            GetPCLevel(oCreature)<=iMaxLvl)
        {
            break;
        }
        oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, oObject, i++, CREATURE_TYPE_IS_ALIVE, TRUE);
    }
    return oCreature;
}



5. , oWeapon.

Neverwinter Script Source
int GetIsRangedWeapon(object oWeapon)
{
    if (GetIsObjectValid(oWeapon))
    {
        int iBIT = GetBaseItemType(oWeapon);
        if (iBIT == BASE_ITEM_DART||
            iBIT == BASE_ITEM_HEAVYCROSSBOW||
            iBIT == BASE_ITEM_LIGHTCROSSBOW||
            iBIT == BASE_ITEM_LONGBOW||
            iBIT == BASE_ITEM_SHORTBOW||
            iBIT == BASE_ITEM_SHURIKEN||
            iBIT == BASE_ITEM_SLING||
            iBIT == BASE_ITEM_THROWINGAXE)
        {
            return TRUE;
        }
    }
}


6. , 1: 0 ( .) , 1- , 2 - , .

Neverwinter Script Source
int GetHasWeapon(object oTarget, int nType)
{
    int WInv = FALSE;
    int WSlot= FALSE;
    int iResult;
    object oItem = GetFirstItemInInventory(oTarget);
    while (GetIsObjectValid(oItem))
    {
        if (GetIsWeapon(oItem))
        {
        WInv = TRUE;
        break;
        }
    oItem = GetNextItemInInventory(oTarget);
    }
    int i;
    for (i=4; i<=5; i++)
    {
    oItem = GetItemInSlot(i, oTarget);
        if (GetIsWeapon(oItem))
        {
        iWSlot = TRUE;
        break;
        }
    }
    if (nType==0) { iResult = iWSlot;         }
    else
    if (nType==1) { iResult = iWInv;          }
    else
    if (nType==2)
    {
        if (iWSLot==TRUE||iWInv==TRUE)
        { return TRUE; } else { return FALSE; }
    }
    else { return -1; }
    return iResult;
}


7. , : , .

Neverwinter Script Source
int GetHasFighterClass(object oObject)
{
    int nClass1 = GetLevelByClass(CLASS_TYPE_BARBARIAN, GetPCSpeaker());
    int nClass2 = GetLevelByClass(CLASS_TYPE_FIGHTER, GetPCSpeaker());
    int nClass3 = GetLevelByClass(CLASS_TYPE_MONK, GetPCSpeaker());
    int nClass4 = GetLevelByClass(CLASS_TYPE_RANGER, GetPCSpeaker());
    if ((nClass1 > 0) || (nClass2 > 0) || (nClass3 > 0) || (nClass4 > 0))
    {
        return TRUE;
    }
    else return FALSE;
}


8. . .

Neverwinter Script Source
float GetRandomDelay(float fMinimumTime = 0.4, float MaximumTime = 1.1)
{
    float fRandom = MaximumTime - fMinimumTime;
    int nRandom;
    if(fRandom < 0.0)
    {
        return 0.0;
    }
    else
    {
        nRandom = FloatToInt(fRandom  * 10.0);
        nRandom = Random(nRandom) + 1;
        fRandom = IntToFloat(nRandom);
        fRandom /= 10.0;
        return fRandom + fMinimumTime;
    }
}


9. - oTarget.

Neverwinter Script Source
int GetNumItems(object oTarget,string sItem)
{
    int nNumItems = 0;
    object oItem = GetFirstItemInInventory(oTarget);
    while (GetIsObjectValid(oItem))
    {
        if (GetTag(oItem) == sItem)
        {
            nNumItems = nNumItems + GetNumStackedItems(oItem);
        }
        oItem = GetNextItemInInventory(oTarget);
    }
    return nNumItems;
}


!

PS: : . , smile.gif

: Jun 24 2004, 00:53

LEX: , .
: < 0 >-11 ., . - . - . ... : .

Tarre

OnPlayerDying

Neverwinter Script Source
void bleed(int iBleedAmt)
{

effect eShake=EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
effect eBleedEff;
if (GetCurrentHitPoints() <= 0) {
if (iBleedAmt > 0) {
eBleedEff = EffectDamage(iBleedAmt);
} else {
eBleedEff = EffectDamage(iBleedAmt);
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBleedEff, OBJECT_SELF);
if (GetCurrentHitPoints() <= -10) {
PlayVoiceChat(VOICE_CHAT_DEATH);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF);
return;
}

if (iBleedAmt > 0) {
if (d10(1) == 1) {
iBleedAmt = -iBleedAmt;
} else {
switch (d6()) {
case 1: PlayVoiceChat(VOICE_CHAT_PAIN1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShake,OBJECT_SELF,10.0);
DelayCommand(1.5,FadeToBlack(OBJECT_SELF));
BlackScreen(OBJECT_SELF);
DelayCommand(3.0, FadeFromBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
break;
case 2: PlayVoiceChat(VOICE_CHAT_PAIN2);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShake,OBJECT_SELF,10.0);
DelayCommand(1.5,FadeToBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
BlackScreen(OBJECT_SELF);
DelayCommand(3.0, FadeFromBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
break;
case 3: PlayVoiceChat(VOICE_CHAT_PAIN3);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShake,OBJECT_SELF,10.0);
DelayCommand(1.5,FadeToBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
BlackScreen(OBJECT_SELF);
DelayCommand(3.0, FadeFromBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
break;
case 4: PlayVoiceChat(VOICE_CHAT_HEALME);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShake,OBJECT_SELF,10.0);
DelayCommand(1.5,FadeToBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
BlackScreen(OBJECT_SELF);
DelayCommand(3.0, FadeFromBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
break;
case 5: PlayVoiceChat(VOICE_CHAT_NEARDEATH);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShake,OBJECT_SELF,10.0);
DelayCommand(1.5,FadeToBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
BlackScreen(OBJECT_SELF);
DelayCommand(3.0, FadeFromBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
break;
case 6: PlayVoiceChat(VOICE_CHAT_HELP);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShake,OBJECT_SELF,10.0);
DelayCommand(1.5,FadeToBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));
BlackScreen(OBJECT_SELF);
DelayCommand(3.0, FadeFromBlack(OBJECT_SELF,FADE_SPEED_SLOWEST));


}
}
}
DelayCommand(6.0,bleed(iBleedAmt));
}
{

}
}
void main()
{
effect eBlood=EffectVisualEffect(VFX_COM_CHUNK_RED_MEDIUM);
object oDying = GetLastPlayerDying();
object oEnemy = GetLastAttacker();
float fWho = (GetFacing(oEnemy));
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eBlood, GetLocation(oDying), 10.0);
AssignCommand(oDying, ClearAllActions());
AssignCommand(oDying, bleed(1));
CreateObject(OBJECT_TYPE_PLACEABLE,"bloody",GetLocation(oDying),TRUE);

}


"bloody" - .
.. Tarre Object_Type smile.gif

OnPlayerDeath
Neverwinter Script Source
void main()
{
object oPlayer = GetLastPlayerDied();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), GetLocation(oPlayer));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE), oPlayer); // , .
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MAJOR), oPlayer,6.0);
DelayCommand(2.0,FadeToBlack(oPlayer));
DelayCommand(5.0,BlackScreen(oPlayer));

DelayCommand(5.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer));
DelayCommand(5.8,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer));
DelayCommand(6.0,AssignCommand(oPlayer,ClearAllActions()));
DelayCommand(6.2,AssignCommand(oPlayer,JumpToLocation(GetLocation(GetObjectByTag("WP_RAISE")))));
}

WP_RAISE -

- OnEnter
Neverwinter Script Source
void main()
{
object oPC = GetEnteringObject();
DelayCommand(2.0,FadeFromBlack(oPC,FADE_SPEED_SLOWEST));
}

: Tarre Talliorne Jul 3 2004, 19:16

: (1) (2).

Neverwinter Script Source
void ActionRemoveEffect(object oCreature, effect eEffect)
    {
        effect eMSD = GetFirstEffect(oCreature);
        while (GetIsEffectValid(eMSD))
        {
            if (GetEffectType(eMSD) == GetEffectType(eEffect))
            {
            RemoveEffect(oCreature, eMSD);
            }
        eMSD = GetNextEffect(oCreature);
        }
    }


Neverwinter Script Source
int HasEffect(object oCreature, effect eEffect)
    {
        int iResult = 0;
        effect eMSD = GetFirstEffect(oCreature);
        while (GetIsEffectValid(eMSD))
        {
            if (GetEffectType(eMSD) == GetEffectType(eEffect))
            {
            iResult = 1;
            }
        eMSD = GetNextEffect(oCreature);
        }
        return iResult;
    }

- ... . : ( - smile.gif )
Neverwinter Script Source
object oFPC = GetLastAttacker();
        object OS = OBJECT_SELF;     
        DelayCommand(0.10, ClearAllActions(TRUE));
        DelayCommand(0.60, ActionUseFeat(FEAT_KNOCKDOWN, oFPC));
        DelayCommand(0.61, ApplyEffectToObject(1, EffectKnockdown(), oFPC, 3.0));
        DelayCommand(1.00, ClearAllActions(TRUE));
        if (GetCurrentHitPoints(OS)<=0)
        {
        // ... , ... , (.. , ), , ...
        }
        else
        {
        DelayCommand(1.04, SetStandardFactionReputation(REPUTATION_TYPE_ENEMY, 50, oFPC));
        DelayCommand(5.10, ClearAllActions(TRUE));
        DelayCommand(5.20, ActionMoveToObject(oFPC, FALSE, 1.4));
        }
        // , - - .

: Tarre Talliorne Jul 4 2004, 13:39

Neverwinter Script Source
object oFPC = GetLastAttacker();
      object OS = OBJECT_SELF;     
      effect eEffect = EffectImmunity(IMMUNITY_TYPE_KNOCKDOWN);
      if (HasEffect(oFPC))
      {
      ActionRemoveEffect(oFPC, eEffect);
      }
      DelayCommand(0.10, ClearAllActions(TRUE));
      DelayCommand(0.60, ActionUseFeat(FEAT_KNOCKDOWN, oFPC));
      DelayCommand(0.61, ApplyEffectToObject(1, EffectKnockdown(), oFPC, 3.0));
      DelayCommand(1.00, ClearAllActions(TRUE));
      if (GetCurrentHitPoints(OS)<=0)
      {
      // ... , ... , (.. , ), , ...
      }
      else
      {
      DelayCommand(1.04, SetStandardFactionReputation(REPUTATION_TYPE_ENEMY, 50, oFPC));
      DelayCommand(5.10, ClearAllActions(TRUE));
      DelayCommand(5.20, ActionMoveToObject(oFPC, FALSE, 1.4));
      }
      // , - - .
... , , - :-)
- , (, , .. EFFECT_TYPE_IMMUNITY). , ... , , ...

: Tarre Talliorne Jul 4 2004, 20:05

, - , : ( ActionRemoveObject(. . .) ), ... , "" . - ... , :-)
, : - , . .

-----------------------------------------------------
: - , : ., , .. - ... __... .

Neverwinter Script Source
void main()
{
    SpeakString("This is what would happen if the store started"); // Store Open Script
    object oInv = GetFirstItemInInventory();
        while (GetIsObjectValid(oInv)) // -
        {
            string sOS = GetTag(OBJECT_SELF); //
            if  (sOS == "store1") // - "store1", , BASE_ITEM_POTIONS BASE_ITEM_SCROLL...
            {
                if (GetBaseItemType(oInv)!=BASE_ITEM_POTIONS&&
                    GetBaseItemType(oInv)!=BASE_ITEM_SCROLL  )
                {
                DestroyObject(oInv);
                }
            }
            else if (sOS == "store2")
            {
            // , "store2",
            }
        oInv = GetNextItemInInventory();
        }
}

: Tarre Talliorne Jul 7 2004, 15:45

Neverwinter Script Source
const string TXT_COLOR_GRAY    = "<c>"; // Gray
const string TXT_COLOR_WHITE    = "<c>"; // White
const string TXT_COLOR_CYAN    = "<c >"; // Light Cyan
const string TXT_COLOR_MAGENTA  = "<c >"; // Magenta
const string TXT_COLOR_YELLOW   = "<c >"; // Yellow
const string TXT_COLOR_RED      = "<c  >"; // Red
const string TXT_COLOR_GREEN    = "<c >"; // Green
const string TXT_COLOR_BLUE    = "<c  >"; // Blue
const string TXT_COLOR_NONE    = "";       // Default (no color)
const string TXT_COLOR_END      = "</c>";   // (color end TAG)
const string TXT_COLOR_DEFAULT  = TXT_COLOR_CYAN;


// Function changes color of the string
// * Param sText - text to color
// * Param sColor - parse a color constant here
// * Returns colored string
string colorText(string sText, string sColor);


string colorText(string sText, string sColor)
{
  return sColor + sText + TXT_COLOR_END;
}


. __ 4 . . .

: Tarre Talliorne Jul 7 2004, 21:00

. :
"lib_colortext". _ .
you are entering object, , (TXT_COLOR_RED). TXT_COLOR_RED TXT_COLOR_YELLOW , . .

Neverwinter Script Source
#include "lib_colortext"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
AssignCommand(oPC, SpeakString(colorText("you are entering object", TXT_COLOR_RED)));
}

: Jul 10 2004, 06:22

. ... . . .
N- (Plate) , . , "" .. "letter_r". - . . , , - "". (Usable).
, . - , - .

OnUsed -

Neverwinter Script Source
/////////////////////////////////////////
////// Script for Coded Door ////////////
/////// OnUsed any plate ////////////////
//////// Date: 10.07.2004 ///////////////
///////// Created by Avaddon ////////////
/////////////////////////////////////////

void main()
{
string sCode = GetLocalString(GetObjectByTag("code_lock"),"code"); //code_lock - .
string sName = GetName(OBJECT_SELF);
object oCodedDoor = GetObjectByTag("coded_door"); //
if (GetLocked(oCodedDoor)==TRUE)
{
if (sName=="")
{
// .
SetLocalString(GetObjectByTag("code_lock"), "code", sCode+" ");
SendMessageToPC(GetLastUsedBy()," ["+sName+"]");
SendMessageToPC(GetLastUsedBy()," : ["+sCode+" ]");
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), GetLocation(OBJECT_SELF)); // .
}
else
{
// , .
SetLocalString(GetObjectByTag("code_lock"), "code", sCode+sName);
SendMessageToPC(GetLastUsedBy()," ["+sName+"]");
SendMessageToPC(GetLastUsedBy()," : ["+sCode+sName+"]");
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE), GetLocation(OBJECT_SELF));
// .
}
}
else
{
SendMessageToPC(GetLastUsedBy(),".. ."); // .
}
}


OnUsed "code_lock"
Neverwinter Script Source
/////////////////////////////////////////
////// Script for Coded Door ////////////
/////// OnUsed some Lever ///////////////
//////// Date: 10.07.2004 ///////////////
///////// Created by Avaddon ////////////
/////////////////////////////////////////

void main()
{
string sNull=""; // .
string sCode = GetLocalString(OBJECT_SELF,"code"); //
object oCodedDoor = GetObjectByTag("coded_door"); //
object oPC = GetLastUsedBy();
effect eOpen = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION); // .

if (GetLocked(oCodedDoor)==TRUE)
{
// - - .
if (sCode==" ")
{
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);//
DelayCommand(2.0,PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
SetLocked(oCodedDoor, FALSE); // .
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eOpen,oCodedDoor,5.0); // .
SendMessageToPC(GetLastUsedBy()," . ");
ActionOpenDoor(oCodedDoor); //
SetLocalString(OBJECT_SELF,"code",sNull); //
}
else
{
SendMessageToPC(GetLastUsedBy()," .");
AssignCommand (OBJECT_SELF, ActionCastSpellAtObject(SPELL_ELECTRIC_JOLT, oPC, PROJECTILE_PATH_TYPE_DEFAULT)); // .
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);//
DelayCommand(2.0,PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
SetLocalString(OBJECT_SELF,"code",sNull); //
}
}
else
{
SendMessageToPC(oPC," ."); //
}
}


http://saigh.fatal.ru/files/Coded_Door.rar. 9.

: Jul 11 2004, 04:01

, .
, CDKey . SetLocalString smile.gif - Undropable. .

, - . 3 : "", "", "". ( ). 1 . - , .
LocalInt .

OnSpawn

Neverwinter Script Source
/////////////////////////////////////////
////// Script for Interactive ///////////
///////// Mini Bank System //////////////
/////// OnSpawn NPC Banker //////////////
//////// Date: 11.07.2004 ///////////////
///////// Created by Avaddon ////////////
/////////////////////////////////////////

void main()
{
object oPC = GetLastSpeaker();
SetListening(OBJECT_SELF, 1);
SetListenPattern(OBJECT_SELF,"",1);
SetListenPattern(OBJECT_SELF,"",2);
SetListenPattern(OBJECT_SELF,"",3);
SetListenPattern(OBJECT_SELF,"",4);
SetListenPattern(OBJECT_SELF,"",5);
}


OnConversation

Neverwinter Script Source
/////////////////////////////////////////
////// Script for Interactive ///////////
///////// Mini Bank System //////////////
/////// OnConversarion NPC Banker ///////
//////// Date: 11.07.2004 ///////////////
///////// Created by Avaddon ////////////
/////////////////////////////////////////

#include "nw_i0_tool"
void main()
{
object oPC = GetLastSpeaker();
object oOffer = GetItemPossessedBy(oPC, "bank_offer"); // bank_offer - .
int iAmount = StringToInt (GetMatchedSubstring (0));
int iAccount = GetLocalInt(oOffer, "money");
string sBallance = IntToString(iAccount);
string sBallancePlus = IntToString(iAccount+iAmount);
string sBallanceMinus = IntToString(iAccount-iAmount);
if(HasItem(oPC, "bank_offer"))
{
if (GetListenPatternNumber()==10 && GetIsListening(OBJECT_SELF) && GetLocalInt(oPC,"account")==1)
{
if (iAmount>0)
{
if (iAmount<=GetGold(oPC))
{
SpeakString(" "+GetMatchedSubstring(0)+" .");
TakeGoldFromCreature(iAmount,oPC,TRUE);
SetLocalInt(oOffer,"money",iAccount+iAmount);
SpeakString (" = "+sBallancePlus+" .");
DeleteLocalInt(oPC,"account");
SetListenPattern(OBJECT_SELF,"DELETED",10);
}
else
{
SpeakString(" ");
}
}
else
{
SpeakString(" ");
}
}

if (GetListenPatternNumber()==10 && GetIsListening(OBJECT_SELF) && GetLocalInt(oPC,"account")==2)
{
if (iAmount>0)
{

if (iAmount<=GetLocalInt(oOffer,"money"))
{
SpeakString(" "+GetMatchedSubstring(0)+" .");
GiveGoldToCreature(oPC,iAmount);
SetLocalInt(oOffer,"money",iAccount-iAmount);
SpeakString (" = "+sBallanceMinus+" .");
DeleteLocalInt(oPC,"account");
SetListenPattern(OBJECT_SELF,"DELETED",10);
}
else
{
SpeakString(" ");
}
}
else
{
SpeakString(" ");
}
}

if (GetListenPatternNumber()==1 && GetIsListening(OBJECT_SELF))
{

SpeakString (" ?");
SetListenPattern(OBJECT_SELF,"**",10);
SetLocalInt(oPC,"account",1);

}
if (GetListenPatternNumber()==2 && GetIsListening(OBJECT_SELF))
{
SetListenPattern(OBJECT_SELF,"DELETED",10);
SpeakString (" ?");
SetListenPattern(OBJECT_SELF,"**",10);
SetLocalInt(oPC,"account",2);
}

if (GetListenPatternNumber()==3 && GetIsListening(OBJECT_SELF))
{
SpeakString (" = "+sBallance+" .");
}
}
else
{
if (GetListenPatternNumber()==1 && GetIsListening(OBJECT_SELF))
{
SpeakString (", ? ? . [] []");
SetLocalInt(oPC,"new_account", TRUE);
DelayCommand(60.0 , DeleteLocalInt(oPC,"new_account"));
}
if (GetListenPatternNumber()==2 && GetIsListening(OBJECT_SELF))
{
SpeakString (", ? ? . [] []");
SetLocalInt(oPC,"new_account", TRUE);
DelayCommand(60.0 , DeleteLocalInt(oPC,"new_account"));
}
if (GetListenPatternNumber()==3 && GetIsListening(OBJECT_SELF))
{
SpeakString (", ? ? . [] []");
SetLocalInt(oPC,"new_account", TRUE);
DelayCommand(60.0 , DeleteLocalInt(oPC,"new_account"));
}
if (GetListenPatternNumber()==4 && GetIsListening(OBJECT_SELF) && GetLocalInt(oPC,"new_account")== TRUE)
{
CreateItemOnObject("bank_offer", oPC, 1);
SetLocalInt(oOffer, "money", 0);
SpeakString(" , ! !");
SetListenPattern(OBJECT_SELF,"DELETED",10);
}
if (GetListenPatternNumber()==5 && GetIsListening(OBJECT_SELF) && GetLocalInt(oPC,"new_account")== TRUE)
{
SpeakString (" , .");
DeleteLocalInt(oPC,"new_account");
}


}
}


: good.gif

: Tarre Talliorne Jul 17 2004, 20:55

. ( , , , ), . ( :-) ) . , . : (string RusGenetiv). nSex - : 1 - , 2 - , 3 - .
150 . , , - , , .
: Dativ & Akkusativ ( Genetic ) ( - :-) ), . ( + + )
:

Neverwinter Script Source
//
//   [SCRIPTED BY TARRE TALLIORNE! (TARRE@list.ru)]
string OrfographieTest(string sString);

// sWord ;
// - "" ( nSex ):
// 1 - ,
// 2 - ,
// 3 - .
//   [SCRIPTED BY TARRE TALLIORNE! (TARRE@list.ru)]
string RusGenetiv(string sWord, int nSex);

string ya()
{
return GetName(GetWaypointByTag("ya"));
}

int GetIsSound(string sLetter)
{
    int iResult = 0;
    //:://
    if (sLetter != ""&&
        sLetter != ""&&
        sLetter != "" &&
        GetStringLength(sLetter)==1)
        {
        iResult = 1;
        }
    return iResult;
}

int GetIsVowel(string sLetter)
{
    int iResult = 0;
    if (!GetIsSound(sLetter))
        return iResult = -1;
    if (sLetter=="" ||
        sLetter=="" ||
        sLetter=="" ||
        sLetter=="" ||
        sLetter=="" ||
        sLetter=="" ||
        sLetter=="" ||
        sLetter=="" ||
        sLetter==ya() )
        {
        iResult = 1;
        }
    return iResult;
}

/*int GetIsSoft(string sLetter, string sNextLetter)
{
    int iResult;
    if (!GetIsSound(sLetter)                ||
       ( GetStringLength(sNextLetter)!=0    &&
         GetStringLength(sNextLetter)!=1)   ||
         GetIsVowel(sLetter))
         return iResult = -1;
    else if (sLetter == "")
         return iResult = 1;
    else if (sNextLetter == "")
         return iResult = 1;
}*/


string OrfographieTest(string sString)
{
    //:://///////////:://
    //::// - //:://
    //:://///////////:://

    //:://
    string sNew;
    int nZHi = FindSubString(sString, "");
    int nzhi = FindSubString(sString, "");
    int nSHi = FindSubString(sString, "");
    int nshi = FindSubString(sString, "");

    //::// ""
    if (nZHi!=-1)
    {
    int nZH = nZHi;
    int nI = nZH + 1;
    string s1 = GetStringLeft(sString, nI);
    string s2 = GetStringRight(sString, GetStringLength(sString)-nI-1);
    sNew = s1+""+s2;
    }

    //::// ""

    else if (nzhi!=-1)
    {
    int nzh = nzhi;
    int nI = nzh + 1;
    string s1 = GetStringLeft(sString, nI);
    string s2 = GetStringRight(sString, GetStringLength(sString)-nI-1);
    sNew = s1+""+s2;
    }

    //::// ""
    else if (nSHi!=-1)
    {
    int nSH = nSHi;
    int nI = nSH + 1;
    string s1 = GetStringLeft(sString, nI);
    string s2 = GetStringRight(sString, GetStringLength(sString)-nI-1);
    sNew = s1+""+s2;
    }

    //::// ""
    else if (nshi!=-1)
    {
    int nsh = nshi;
    int nI = nsh + 1;
    string s1 = GetStringLeft(sString, nI);
    string s2 = GetStringRight(sString, GetStringLength(sString)-nI-1);
    sNew = s1+""+s2;
    }

    //::// , sString
    else sNew = sString;
    return sNew;
}

string RusGenetiv(string sWord, int nSex)
{
    string sGenLast;
    string sOsnov;
    string sGenetiv;
    string sLast = GetStringRight(sWord, 1);
    //::////////////////////////////////////////////////:://
    //::// DEBUGGING [ deleted by author at 17.07.04 ]//:://
    //::// SpeakDebugString(OBJECT_SELF, sLast);////////:://
    //::////////////////////////////////////////////////:://
    switch (nSex)
    {
    //:://///////////////:://
    //::// //:://
    //:://///////////////:://
    case 1:
        //:://
        if (sLast==""||sLast==ya()||sLast==""||sLast=="")
        {
            if (sLast=="")
                sGenLast = "";
                    else if (sLast==ya())
                        sGenLast = "";
                            else if (sLast==""||
                                sLast=="")
                                    sGenLast = ya();
        sOsnov = GetStringLeft(sWord, GetStringLength(sWord)-1);
        sGenetiv = sOsnov + sGenLast;
        }
        //:://
        else if (sLast==""||
                 sLast==""||
                 sLast==""||
                 sLast==""||
                 sLast==""||
                 sLast=="")
                 {
                 sGenetiv = sWord;
                 }
                 //::// ""
        else {
        sGenLast = "";
        sOsnov = GetStringLeft(sWord, GetStringLength(sWord));
        sGenetiv = sOsnov + sGenLast;
        }
    break;

    //:://///////////////:://
    //::// //:://
    //:://///////////////:://
    case 2:
        //:://
        if (sLast=="")
        {
        sGenLast = "";
        sOsnov = GetStringLeft(sWord, GetStringLength(sWord)-1);
        sGenetiv = sOsnov + sGenLast;
        }
        else if (sLast==ya()||sLast=="")
        {
        sGenLast = "";
        sOsnov = GetStringLeft(sWord, GetStringLength(sWord)-1);
        sGenetiv = sOsnov + sGenLast;
        }
        //:://
        else
        {
        sGenetiv = sWord;
        }
    break;

    //:://///////////////:://
    //::// //:://
    //:://///////////////:://
    case 3:
        if (sLast=="")
        {
        sGenLast = "";
        sOsnov = GetStringLeft(sWord, GetStringLength(sWord)-1);
        sGenetiv = sOsnov + sGenLast;
        }
        if (sLast=="")
        {
        sGenLast = ya();
        sOsnov = GetStringLeft(sWord, GetStringLength(sWord)-1);
        sGenetiv = sOsnov + sGenLast;
        }
        else sGenetiv = sWord;
    break;
    }
    sGenetiv = OrfographieTest(sGenetiv);
    return sGenetiv;
}

: Valleo Jul 21 2004, 19:58

, .
: , , , .
=)

Neverwinter Script Source
//############################################################################//
//*        *//
//*      Valleo, "",       *//
//############################################################################//

//*
void NoCheatDeleteAndSetItemProperty(object oItem, itemproperty iItemProperty);

//* , , - FALSE
int NoCheatCheckItemProperty(itemproperty iItemProperty);

//*
void NoCheatItemProperty(object oItem);

//*
void NoCheatStarting(object oPC);

//############################################################################//

void NoCheatDeleteAndSetItemProperty(object oItem, itemproperty iItemProperty)
{
itemproperty iNewItemPropert;
int iItemPropertyType = GetItemPropertyType(iItemProperty);
int iItemPropertySubType;
if(iItemPropertyType == ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS)
  {
  iItemPropertySubType = GetItemPropertySubType(iItemProperty);
  if(iItemPropertySubType == IP_CONST_IMMUNITYMISC_DEATH_MAGIC)
   {
   iNewItemPropert = ItemPropertyCastSpell(IP_CONST_CASTSPELL_DEATH_WARD_7, IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY);
   RemoveItemProperty(oItem,iItemProperty);
   AddItemProperty(DURATION_TYPE_PERMANENT,iNewItemPropert,oItem);
   }
  if(iItemPropertySubType == IP_CONST_IMMUNITYMISC_KNOCKDOWN)
   {
   iNewItemPropert = ItemPropertySkillBonus(SKILL_DISCIPLINE,10);
   RemoveItemProperty(oItem,iItemProperty);
   AddItemProperty(DURATION_TYPE_PERMANENT,iNewItemPropert,oItem);
   }
  if(iItemPropertySubType == IP_CONST_IMMUNITYMISC_CRITICAL_HITS)
   {
   iNewItemPropert = ItemPropertySkillBonus(SKILL_TUMBLE,10);
   RemoveItemProperty(oItem,iItemProperty);
   AddItemProperty(DURATION_TYPE_PERMANENT,iNewItemPropert,oItem);
   }
  }
if(iItemPropertyType == ITEM_PROPERTY_HASTE)
  {
  iNewItemPropert = ItemPropertyCastSpell(IP_CONST_CASTSPELL_HASTE_5, IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY);
  RemoveItemProperty(oItem,iItemProperty);
  AddItemProperty(DURATION_TYPE_PERMANENT,iNewItemPropert,oItem);
  }
if(iItemPropertyType == ITEM_PROPERTY_TRUE_SEEING)
  {
  iNewItemPropert = ItemPropertyCastSpell(IP_CONST_CASTSPELL_TRUE_SEEING_9, IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY);
  RemoveItemProperty(oItem,iItemProperty);
  AddItemProperty(DURATION_TYPE_PERMANENT,iNewItemPropert,oItem);
  }
if(iItemPropertyType == ITEM_PROPERTY_FREEDOM_OF_MOVEMENT)
  {
  iNewItemPropert = ItemPropertyCastSpell(IP_CONST_CASTSPELL_FREEDOM_OF_MOVEMENT_7, IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY);
  RemoveItemProperty(oItem,iItemProperty);
  AddItemProperty(DURATION_TYPE_PERMANENT,iNewItemPropert,oItem);
  }
}

int NoCheatCheckItemProperty(itemproperty iItemProperty)
{
int iDurationType = GetItemPropertyDurationType(iItemProperty);
if(iDurationType != DURATION_TYPE_PERMANENT)return FALSE;

int iItemPropertyType = GetItemPropertyType(iItemProperty);
if(iItemPropertyType == ITEM_PROPERTY_HASTE) return TRUE;
if(iItemPropertyType == ITEM_PROPERTY_TRUE_SEEING) return TRUE;
if(iItemPropertyType == ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS) return TRUE;
if(iItemPropertyType == ITEM_PROPERTY_FREEDOM_OF_MOVEMENT) return TRUE;
return FALSE;
}

void NoCheatItemProperty(object oItem)
{
itemproperty iItemProperty = GetFirstItemProperty(oItem);
while(GetIsItemPropertyValid(iItemProperty))
  {
  if(NoCheatCheckItemProperty(iItemProperty) && !GetPlotFlag(oItem)) NoCheatDeleteAndSetItemProperty(oItem, iItemProperty);
  iItemProperty = GetNextItemProperty(oItem);
  }
}

void NoCheatStarting(object oPC)
{
object oItem;
oItem = GetFirstItemInInventory(oPC);
while(oItem != OBJECT_INVALID)
  {
  NoCheatItemProperty(oItem);
  oItem = GetNextItemInInventory(oPC);
  }
int iSlot = 0;
for (iSlot; iSlot<14; iSlot++)
{
oItem = GetItemInSlot(iSlot, oPC);
if(GetIsObjectValid(oItem)) NoCheatItemProperty(oItem);
}
}

//############################################################################//

void main()
{
object oPC = GetEnteringObject(); //* , On Enter
NoCheatStarting(oPC);
}

: Aiwan Jul 23 2004, 22:41

, POST_- 15 , .

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: Copyright © 2004 WRG!
//:://////////////////////////////////////////////
/*
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 23.07.2004
//:://////////////////////////////////////////////

int StartingConditional()
{
    string sTag = ("POST_"+GetTag(OBJECT_SELF));
    object oWp = GetWaypointByTag(sTag);

    if (GetIsObjectValid(oWp) && GetDistanceBetween(oWp, OBJECT_SELF) > 15.0f)
        return TRUE;
    return FALSE;
}

: Valleo Jul 25 2004, 18:31

, , :

Neverwinter Script Source
object oPC = GetLastPCRested();
if(GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
  {
  SendMessageToPC(oPC," ."); //
  AssignCommand(oPC, ClearAllActions());
  }

: Lex Aug 12 2004, 20:15

: _kaa_

:

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: NW_S3_Alcohol.nss
//:: Copyright 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Makes beverages fun.
May 2002: Removed fortitude saves. Just instant intelligence loss
*/

//:://////////////////////////////////////////////
//:: Created By:  Brent
//:: Created On:  February 2002
//:://////////////////////////////////////////////

void DrinkIt(object oTarget)
{
  // AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_FIREFORGET_DRINK));
  AssignCommand(oTarget,ActionSpeakStringByStrRef(10499));
}

void MakeDrunk(object oTarget, int nPoints)
{
if (Random(100) + 1 < 40)
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING));
else
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK));

effect eDumb = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nPoints);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDumb, oTarget, 60.0);
//  AssignCommand(oTarget, SpeakString(IntToString(GetAbilityScore(oTarget,ABILITY_INTELLIGENCE))));
}
void main()
{
object oTarget = GetSpellTargetObject();
  // SpeakString("here");
// * Beer
if (GetSpellId() == 406)
{
// *burp*
//AssignCommand(oTarget, SpeakString("Beer"));
DrinkIt(oTarget);
// if (FortitudeSave(oTarget, d20()+10) == TRUE)
{
MakeDrunk(oTarget, 1);
}
}
else
// *Wine
if (GetSpellId() == 407)
{
DrinkIt(oTarget);
// if (FortitudeSave(oTarget, d20()+10 +2) == TRUE)
{
MakeDrunk(oTarget, 2);
}
}
else
// * Spirits
if (GetSpellId() == 408)
{
DrinkIt(oTarget);
// if (FortitudeSave(oTarget, d20()+10) == TRUE)
{
MakeDrunk(oTarget, 3);
}
  }

}


-:

smile.gif
. , , .

Neverwinter Script Source
object oItem = GetSpellCastItem();
if (GetStringUpperCase(GetStringLeft(GetTag(oItem),13))=="AX_IT_POISON_"){
float PoisonType = StringToFloat(GetStringRight(GetTag(oItem),GetStringLength(GetTag(oItem))-13));
DelayCommand(PoisonType, ExecuteScript("lg_anim_death",oTarget));

: `lg_anim_death`
Neverwinter Script Source
void main()
{
AssignCommand(OBJECT_SELF,ClearAllActions());
AssignCommand(OBJECT_SELF,ActionPlayAnimation(ANIMATION_LOOPING_SPASM));
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectKnockdown(),OBJECT_SELF,4.0));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectDeath(TRUE),OBJECT_SELF));
DelayCommand(4.0, SendMessageToPC(OBJECT_SELF,"Âàñ îòðàâèëè"));


[mergetime]1092332152[/mergetime]
<small> 17:26</small>



,

object oJamp = GetTransitionTarget(OBJECT_SELF);
if (GetIsPC(oPC))
{
AssignCommand(oPC, JumpToObject(oJamp));


:

string sJamp = GetTag(GetTransitionTarget(OBJECT_SELF));
....
JumpToObject(GetObjectByTag(sJamp));


************************************************
tag = mask + INtToString(Number);
mask = "WP_NPCTAG_"
Number = 1..12

*************************************************

DestroyObject(GetItemInSlot(INVENTORY_SLOT_CARMOR,oPC));

*************************************************
>    

object oItem=GetModuleItemAcquired();
if(GetTag(oItem)=="SEAMAGAZIN_PIRAT")
{
 if(GetLocalInt(oItem,"DO_ONCE")!=1 && GetItemPossessor(oItem) == GetFirstPC())
  {
 AddJournalQuestEntry("ANDRA_PIRATES", 4, GetFirstPC());
 SetLocalInt(oItem,"DO_ONCE",1);
  }
}

*****************************************************
> .
SetLocalInt(_1, "_1", GetLocalInt(_1, "_1") + 1);

?
_1 = OBJECT_SELF -
           
GetEnteringObject() -

********************************          
>
int StartingConditional()
{

  // Add the randomness
  if(Random(100) >= 15)
      return FALSE;

  return TRUE;
}

*************************************************
> .
reateObject "new_tag"
, , :
void main()
{
int i=0;
object oScelet = GetObjectByTag("new_tag",i);
while (oScelet!=OBJECT_INVALID)
 {
 DestroyObject(oScelet);
 i++;
 oScelet = GetObjectByTag("new_tag",i)
 }
}

****************************************************
>

if (GetTag(GetItemInSlot(INVENTORY_SLOT_CARMOUR,GetPCSpeaker())==" ")

>***************************************
>
object oPC = GetEnteringObject();
object oDoor = GetObjectByTag("_1"); //
if (!GetIsPC(oPC))
   return;
if (GetLocalInt(oPC, "FLOODED") == 1)
  oDoor = GetObjectByTag("_2"); //
AssignCommand(oDoor, ActionOpenDoor(oDoor));
AssignCommand(oPC, JumpToObject(oDoor));

>***************************************
// PC !!!

void main()
{
object oPC = GetPCSpeaker();
object oItem = GetItemPossessedBy(oPC, "ZAVTRAK");
if (GetTag(oItem) == "ZAVTRAK")
{
 SpeakString(" !");
 DestroyObject(oItem); //
}
else
{
 SpeakString("! ?");
}
}
>******************************************
// !!!

void main()
{
object oPC = GetPCSpeaker();
object oItem = GetObjectByTag("ZAVTRAK");
if (GetTag(GetItemPossessedBy(oPC, "ZAVTRAK")) == "ZAVTRAK")
{
 SpeakString(" !");
 ActionGiveItem(oItem, oPC);  //
}
else
{
 SpeakString("! ?");
}
}

>******************************************
void main()
{
object oPC = GetPCSpeaker();
object oItem = GetItemPossessedBy(oPC, "MINERS_PISMO");
object oNos = GetObjectByTag("SUPER_NOS_IN_MARKET");
AssignCommand (oNos, JumpToObject(GetObjectByTag("POISON_SUPER_NOS")));
if (GetTag(oItem) == "MINERS_PISMO")
{
 DestroyObject(oItem); //
 SpeakString(", !");
}
}
>******************************************
> ,
object oPC = GetFirstPC();
CreateItemOnObject("ResRef-", oPC, );

...
. 2
:)...
>******************************************

<small> 17:29</small>
Valleo

:
Neverwinter Script Source
void StartBog()
{
object oBog = OBJECT_SELF;
object oArea = GetArea(oBog);
location lLocation = GetLocation(oBog);
location lLoc;
location lLocat;
object oObject = GetFirstObjectInShape(SHAPE_SPHERE,100.0,lLocation,FALSE,OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oObject))
{
lLoc = GetLocation(oObject);
lLocat = GetLocalLocation(oObject,"BOGLOC");
if(GetIsObjectValid(GetAreaFromLocation(lLocat)))
  {
  float fDist = GetDistanceBetweenLocations(lLoc,lLocat);
  if(fDist < 5.0)
   {
   effect eSlow = EffectMovementSpeedDecrease(75);
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eSlow,oObject,70.0);
   FloatingTextStringOnCreature(" ...",oObject,FALSE);
   }
  }
SetLocalLocation(oObject,"BOGLOC",lLoc);
oObject = GetNextObjectInShape(SHAPE_SPHERE,100.0,lLocation,FALSE,OBJECT_TYPE_CREATURE);
}
}
void main()
{
object oBog = OBJECT_SELF;
int iTimer = GetLocalInt(oBog,"TIMER");
if(iTimer <= 9)
{
iTimer = iTimer + 1;
SetLocalInt(oBog,"TIMER",iTimer);
return;
}
SetLocalInt(oBog,"TIMER",0);
StartBog();
}

: Aiwan Aug 14 2004, 01:50

, , , . , : " ..." :?)

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Created By: WRG! Aiwan aiwan@e-mail.ru
//:: Created On: 21.12.2003
//:://////////////////////////////////////////////
/*
           
*/

//:://////////////////////////////////////////////
void main()
{
    object oPC = GetPCSpeaker();
    AssignCommand(OBJECT_SELF, ActionPauseConversation());
    AssignCommand(OBJECT_SELF, FadeToBlack(oPC, FADE_SPEED_SLOW));
    AssignCommand(OBJECT_SELF, ActionWait(4.0));
    AssignCommand(OBJECT_SELF, FadeFromBlack(oPC, FADE_SPEED_SLOW));
    SetTime(GetTimeHour()+(Random(4)), GetTimeMinute()+(Random(60)), 0, 0);
    AssignCommand(OBJECT_SELF, ActionResumeConversation());
}

: Twin Oct 2 2004, 15:12

, NPC , . wink.gif - , .. "" .., NPC .

PLC_AUTORESPAWN. , , DelayCommand. "" 8x8, . DelayCommand , . wink.gif
, :

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Created By: Twin
//:: Communication:
//::  E-mail: twin_quad@hotmail.com
//::  IRC: Twin@irc.rinet.ru:6669
//::
//:: Created On: 2004.10
//:://////////////////////////////////////////////

void doSpawn(string sResRef, string sTag, location locWhere, int nRespawnTime, int nMaxSpawns, int nCurrent, int bAnimation);

void cycleSpawn(object oNPC)
{
    object oRespawner = GetObjectByTag("PLC_AUTORESPAWN");
    if ( !GetIsObjectValid(oRespawner) )
        return;

    int nRespawnTime = GetLocalInt(oNPC, "respawn_time");
    if ( nRespawnTime <= 0 )
        return;

    string sWaypoint = GetTag(oNPC);
    if ( FindSubString(sWaypoint, "NPC_") == 0 )
        sWaypoint = GetStringRight(sWaypoint, GetStringLength(sWaypoint) - 4);
    sWaypoint = "WPR_" + sWaypoint;

    int bAnimation = GetLocalInt(oNPC, "respawn_animation");
    int nMaxSpawns = GetLocalInt(oNPC, "respawn_max");
    int nCurrent  = GetLocalInt(oNPC, "respawn_current");
    if ( nCurrent == 0 )
        nCurrent = 1;

    if ( (nMaxSpawns <= 0 || nCurrent < nMaxSpawns) && GetIsObjectValid(GetObjectByTag(sWaypoint)) )
    {
        //SendMessageToPC(GetFirstPC(), "Next respawn in "+ IntToString(nRespawnTime) +" seconds.");
        //SendMessageToPC(GetFirstPC(), "Current/Max: "+ IntToString(nCurrent) +"/"+ IntToString(nMaxSpawns));

        string sResRef = GetResRef(oNPC);
        string sTag = GetTag(oNPC);
        location locWhere = GetLocation(GetObjectByTag(sWaypoint));

        AssignCommand(oRespawner,
            DelayCommand(IntToFloat(nRespawnTime),
                doSpawn(sResRef, sTag, locWhere, nRespawnTime, nMaxSpawns, nCurrent, bAnimation)
            )
        );
    }
}

void doSpawn(string sResRef, string sTag, location locWhere, int nRespawnTime, int nMaxSpawns, int nCurrent, int bAnimation)
{
    object oNPC;
    oNPC = CreateObject(OBJECT_TYPE_CREATURE, sResRef, locWhere, bAnimation, sTag);

    nCurrent++;
    SetLocalInt(oNPC, "respawn_time", nRespawnTime);
    SetLocalInt(oNPC, "respawn_max", nMaxSpawns);
    SetLocalInt(oNPC, "respawn_current", nCurrent);
    SetLocalInt(oNPC, "respawn_animation", bAnimation);

    //SendMessageToPC(GetFirstPC(), "doSpawn("+ sResRef +", "+ sTag +")");
}


NPC, OnDeath UserDefined 1007 ( ) :
Neverwinter Script Source
#include " "


- :
Neverwinter Script Source
cycleSpawn(OBJECT_SELF);


. Variables NPC ( int):
respawn_time - , NPC.
respawn_max - . NPC.
respawn_animation - . NPC [0/1].

Variables NPC, .

NPC "WPR_"+ __NPC. NPC "NPC_", .

.

NPC, . .

- . wink.gif

P.S. ... .

: Oct 9 2004, 18:51

, , . . - . - , . OnHB . Static.

Neverwinter Script Source
void main()
{
object oSelf = OBJECT_SELF;
if (GetIsDay()==FALSE && GetLocalInt(OBJECT_SELF,"on")!=1)
{
SetLocalInt(OBJECT_SELF,"on",1);
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
effect eLight = EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_10);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, oSelf);
}

if (GetIsDay()==TRUE && GetLocalInt(OBJECT_SELF,"on")==1)
{
SetLocalInt(OBJECT_SELF,"on",0);
PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
effect eEffect = GetFirstEffect(oSelf);
while (GetIsEffectValid(eEffect) == TRUE)
{
if (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT)
RemoveEffect(oSelf, eEffect);
eEffect = GetNextEffect(oSelf);
}
}

}

: Oct 12 2004, 20:53

[MoF]Darth_Nick. . . , - biggrin.gif

Neverwinter Script Source
void main()
{
object oPC = GetPCLevellingUp();

if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL)
{
SetCutsceneMode(oPC, TRUE);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oPC), 8.0);
AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_SPASM,1.0,5.0));
DelayCommand(1.0,AssignCommand(oPC,PlayVoiceChat(VOICE_CHAT_LAUGH)));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD), oPC));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HARM), oPC));
DelayCommand(4.0,AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,10.0)));
DelayCommand(3.8,AssignCommand(oPC,PlayVoiceChat(VOICE_CHAT_DEATH)));
DelayCommand(5.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oPC));
DelayCommand(10.0,SetCutsceneMode(oPC, FALSE));
}
else if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD)
{
SetCutsceneMode(oPC, TRUE);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oPC), 8.0);
AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_SPASM,1.0,5.0));
DelayCommand(1.0,AssignCommand(oPC,PlayVoiceChat(VOICE_CHAT_NEARDEATH)));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HOLY_AID), oPC));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUNBEAM), oPC));
DelayCommand(4.0,AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,10.0)));
DelayCommand(3.8,AssignCommand(oPC,PlayVoiceChat(VOICE_CHAT_DEATH)));
DelayCommand(5.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oPC));
DelayCommand(10.0,SetCutsceneMode(oPC, FALSE));
}
else if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL)
{
SetCutsceneMode(oPC, TRUE);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oPC), 8.0);
AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_SPASM,1.0,5.0));
DelayCommand(1.0,AssignCommand(oPC,PlayVoiceChat(VOICE_CHAT_NEARDEATH)));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SOUND_BURST), oPC));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_X), oPC));
DelayCommand(4.0,AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,10.0)));
DelayCommand(3.8,AssignCommand(oPC,PlayVoiceChat(VOICE_CHAT_DEATH)));
DelayCommand(5.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oPC));
DelayCommand(10.0,SetCutsceneMode(oPC, FALSE));
}
}

: Oct 13 2004, 00:05

, smile.gif dntknw.gif
. :

1. () aka
2. .
3. 3 .
4. ( 20 lbs) , . wink.gif (- biggrin.gif )

:
1. ( ..)
2. .
3. .
4. 180 ( )
5. - , - .

:

Item':
- [bedroll]
- [food]
- [wood]

Placeable':
- [camp]
( ) - [place_bedroll]
( aka woodpile biggrin.gif) - [place_wood] .

P.S. Blueprint ResRef

Static! .

...

OnPlayerRest

Neverwinter Script Source
//////////////////////////////////////////////////
////////////Avaddon's Rest System//////////
////////// Script On Player Rest ////////////
////////// Date: 12.10.2004 ///////////////
//////// Created by: Avaddon ////////////
/////////////////////////////////////////////

#include "nw_i0_tool"
void main()
{
object oPC = GetLastPCRested();
object oCamp = GetNearestObjectByTag("camp",oPC);
object oBedroll = GetNearestObjectByTag("place_bedroll",oPC);
effect eSleep = EffectVisualEffect(VFX_IMP_SLEEP);
effect eBlind = EffectBlindness();
effect eDisease = EffectDisease(DISEASE_SOLDIER_SHAKES);

if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED) //
{
if(GetIsObjectValid(oCamp)!=TRUE) //
{
  FloatingTextStringOnCreature(" ",oPC,FALSE);
  AssignCommand(oPC,ClearAllActions()); //
}
  else
  {
  if(GetDistanceBetween(oPC,oCamp)>3.0)
  {
  FloatingTextStringOnCreature(" ",oPC,FALSE);
  AssignCommand(oPC,ClearAllActions()); //
  }
  else
  {
if (HasItem(oPC,"bedroll")==TRUE) //
{
if (HasItem(oPC,"food")==TRUE) //
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eSleep,oPC,30.0); // Z-z-z
FadeToBlack(oPC, FADE_SPEED_SLOW); //
CreateObject(OBJECT_TYPE_PLACEABLE,"place_bedroll",GetLocation(oPC)); //
DestroyObject(GetItemPossessedBy(oPC,"food")); //
DestroyObject(GetItemPossessedBy(oPC,"bedroll")); // (, )
SetLocalInt(oPC,"slept",1); //
}
else
{
FloatingTextStringOnCreature(" ?!",oPC,FALSE);
AssignCommand(oPC,ClearAllActions());
}
}
else
{
FloatingTextStringOnCreature(" ",oPC,FALSE);
AssignCommand(oPC,ClearAllActions());
}
  }
  }
}
  if (GetLastRestEventType() == REST_EVENTTYPE_REST_FINISHED) //
  {
  FadeFromBlack(oPC, FADE_SPEED_SLOW); //
  DestroyObject(oBedroll); //
  SetLocalInt(oPC,"slept",0); //
  CreateItemOnObject("bedroll", oPC,1); //
  if (GetWeight(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC))>20) //
  {
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eDisease,oPC); //
  }

  }

  if (GetLastRestEventType() == REST_EVENTTYPE_REST_CANCELLED) //
  {
  if(GetLocalInt(oPC,"slept")==1) //
  {
  FadeFromBlack(oPC, FADE_SPEED_FAST); //
  DestroyObject(oBedroll); //
  FloatingTextStringOnCreature(" , .",oPC,FALSE);
  ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eSleep,oPC,10.0); //
  ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBlind,oPC,10.0); //
  SetLocalInt(oPC,"slept",0); //
  CreateItemOnObject("bedroll", oPC,1); //
  }
  }

}


UnAcquireItem
Neverwinter Script Source
/////////////////////////////////////////
//////////Avaddon's Rest System//////////
////// Script On UnAcquireItem //////////
//////// Date: 12.10.2004 ///////////////
//////// Created by: Avaddon ////////////
/////////////////////////////////////////
void main()
{
object oLost = GetModuleItemLost();
object oPC = GetModuleItemLostBy();
if (GetTag(oLost)=="wood")
{
CreateObject(OBJECT_TYPE_PLACEABLE,"place_wood",GetLocation(oPC)); //
DestroyObject(oLost); //
}
}


On Used
Neverwinter Script Source
/////////////////////////////////////////
//////////Avaddon's Rest System//////////
////// Script On Used Woodpile //////////
//////// Date: 12.10.2004 ///////////////
//////// Created by: Avaddon ////////////
/////////////////////////////////////////
#include "nw_i0_tool"
void main()
{
object oPC = GetLastUsedBy();

if (GetIsPC(oPC)==TRUE)
{
if (GetTag(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC))=="NW_IT_TORCH001") // -
{
AssignCommand(oPC,PlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,2.0));
CreateObject(OBJECT_TYPE_PLACEABLE,"camp",GetLocation(OBJECT_SELF),TRUE);// -
DestroyObject(OBJECT_SELF); //
}
else
{
DestroyObject(OBJECT_SELF);
CreateItemOnObject("wood",oPC,1); // -
}
}
}


On Heartbeat
Neverwinter Script Source
/////////////////////////////////////////
//////////Avaddon's Rest System//////////
////// Script On Heartbeat Campfire /////
//////// Date: 12.10.2004 ///////////////
//////// Created by: Avaddon ////////////
/////////////////////////////////////////

void main()
{
int iFire = GetLocalInt(OBJECT_SELF,"fire");

if (iFire<1)
{
SetLocalInt(OBJECT_SELF,"fire",6);
}
else
{
SetLocalInt(OBJECT_SELF,"fire",iFire+6);
}

if (iFire>180) // - 180
{
DeleteLocalInt(OBJECT_SELF,"fire");
DestroyObject(OBJECT_SELF);
}
}


. - , .

: Lex Nov 5 2004, 22:10

: .
: .

Neverwinter Script Source
// Make a large SoU bench usable by 3 creatures simultaneously
void main()
{
    // Set some variable for a beter understanding
    object oPlayer = GetLastUsedBy();
    object oBench = OBJECT_SELF;

    // Get a hold on the 3 pillows
    object oPillow1 = GetLocalObject( OBJECT_SELF, "Pillow 1" );
    object oPillow2 = GetLocalObject( OBJECT_SELF, "Pillow 2" );
    object oPillow3 = GetLocalObject( OBJECT_SELF, "Pillow 3" );

    // If "pillow 1" do not exist, create 3 of them and attach them to the bench
    if( !GetIsObjectValid( oPillow1 ) )
    {
        // Set up some variable for understanding
        object oArea = GetArea( oBench );
        vector locBench = GetPosition( oBench );
        float fOrient = GetFacing( oBench );

        // You can change the space between pillows changing this value
        float fSpace = 1.0f;

        // Calculate location of the 3 pillows
        location locPillow1 = Location( oArea, locBench + AngleToVector( fOrient + 90.0f ) * fSpace, fOrient );
        location locPillow2 = Location( oArea, locBench + AngleToVector( fOrient - 90.0f ) * fSpace, fOrient );
        location locPillow3 = Location( oArea, locBench, fOrient );

        // Create the 3 pillows
        oPillow1 = CreateObject( OBJECT_TYPE_PLACEABLE, "plc_invisobj", locPillow1 );
        oPillow2 = CreateObject( OBJECT_TYPE_PLACEABLE, "plc_invisobj", locPillow2 );
        oPillow3 = CreateObject( OBJECT_TYPE_PLACEABLE, "plc_invisobj", locPillow3 );
   
        // "attach" the pillows to the bench
        SetLocalObject( OBJECT_SELF, "Pillow 1", oPillow1 );
        SetLocalObject( OBJECT_SELF, "Pillow 2", oPillow2 );
        SetLocalObject( OBJECT_SELF, "Pillow 3", oPillow3 );
    }
   
    // Get a hold on the nearest invisible object, (maybe a pillow)
    int iDistance = 1;
    object oPillow = GetNearestObjectByTag( "InvisibleObject", oPlayer, iDistance );
   
    // while we find invisible object and that we did not check the 3 linked pillows
    int iCount = 0;
    while( GetIsObjectValid( oPillow ) || iCount < 3 )
    {
        // if it is one of the three pillow linked the the bench
        if( oPillow == oPillow1 || oPillow == oPillow2 || oPillow == oPillow3 )
        {
            iCount = iCount + 1 ;
            // If available
            if( !GetIsObjectValid( GetSittingCreature( oPillow ) ) )
            {
                // Sit and quit the script
                AssignCommand( oPlayer, ActionSit( oPillow ) );
                return;
            }
        }
        // Get the next nearest invisible object
        iDistance = iDistance + 1;
        oPillow = GetNearestObjectByTag( "InvisibleObject", oPlayer, iDistance );
    }
}


: Nov 17 2004, 22:29

. APS/NWNX 2 + MySQL.
, .
- .
MySQL . . :
-
-
-
- IP
- CD-Key
- IP
- CD-Key
-
- -
- ,
- , .
- .
- - .
, PHP - - smile.gif

:

aps_include erf APS/NWNX 2.

OnModuleLoad:

Neverwinter Script Source
#include "aps_include"
void main()
{
SQLInit();
string sSQL="CREATE TABLE `reg_data` ("+
" `status` varchar(64) NOT NULL default '',"+
" `login` varchar(64) NOT NULL default '',"+
" `name` varchar(64) NOT NULL default '',"+
" `gender` char(1) NOT NULL default '',"+
" `race` varchar(100) NOT NULL default '',"+
" `sub_race` varchar(100) NOT NULL default '',"+
" `deity` varchar(100) NOT NULL default '',"+
" `cd_key` varchar(64) NOT NULL default '',"+
" `ip` varchar(25) NOT NULL default '',"+
" `creation_date` datetime NOT NULL default '0000-00-00 00:00:00',"+
") TYPE=MyISAM;";


SQLExecDirect("DESCRIBE reg_data");
// -
if (SQLFetch()!= SQL_SUCCESS)
{
SQLExecDirect(sSQL);
}
}


OnClientEnter:
Neverwinter Script Source
#include "aps_include"
void main()
{
object oPC=GetEnteringObject();
string sName=SQLEncodeSpecialChars(GetName(oPC));//
string sLogin=SQLEncodeSpecialChars(GetPCPlayerName(oPC)); //
string sGender=""; if(GetGender(oPC)==GENDER_FEMALE)sGender="";//
string sKey=GetPCPublicCDKey(oPC); //CD-key
string sIp=GetPCIPAddress(oPC); //Ip
string sDeity=GetDeity(oPC); //
string sStatus = "PC";////
if (GetIsDM(oPC)==TRUE)sStatus = "DM";
string sRace = ""; //
if(GetRacialType(oPC)==RACIAL_TYPE_DWARF)sRace = "";
if(GetRacialType(oPC)==RACIAL_TYPE_ELF)sRace = "";
if(GetRacialType(oPC)==RACIAL_TYPE_GNOME)sRace = "";
if(GetRacialType(oPC)==RACIAL_TYPE_HALFELF)sRace = "";
if(GetRacialType(oPC)==RACIAL_TYPE_HALFLING)sRace = "";
if(GetRacialType(oPC)==RACIAL_TYPE_HALFORC)sRace = "";
if(GetRacialType(oPC)==RACIAL_TYPE_HUMAN)sRace = "";
string sSubrace=GetStringLeft(GetSubRace(oPC), 99);


// SQL - - =
string sSelect = "SELECT cd_key FROM `reg_data` WHERE login='"+GetPCPlayerName(oPC)+
"' AND name='" +GetName(oPC)+ "' AND status='"+sStatus+"'";

// - , , -, , , , -, ip,
string sReg="INSERT INTO reg_data (status, login, name, gender,"+
  "race,sub_race, deity,cd_key,ip,creation_date) "+
  "VALUES('"+sStatus+
      "','"+sLogin+
      "','"+sName+
      "','"+sGender+
      "','"+sRace+
      "','"+sSubrace+
      "','"+sDeity+
      "','"+sKey+
      "','"+sIp+
      "',NOW())";

// ( )
SQLExecDirect(sSelect);
if (SQLFirstRow() == SQL_SUCCESS)
{
SendMessageToPC(oPC," !");

}
else
{
SQLExecDirect(sReg);
SendMessageToPC(oPC," ! !");
}
}

: [MoF]Darth_Nick Nov 18 2004, 05:38

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: Name:
//:://////////////////////////////////////////////
/*
OnEnter (Generic)...
- smile.gif
*/

//:://////////////////////////////////////////////
//:: Created By: [MoF]Darth_Nick
//:://////////////////////////////////////////////

void main()
{
object oPC = GetEnteringObject();
effect eBall = EffectVisualEffect(VFX_FNF_FIREBALL);

if (GetIsPC(oPC) && GetCurrentHitPoints(oPC) <= 70)
{
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBall, oPC));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oPC));
}
else if (GetIsPC(oPC) && GetCurrentHitPoints(oPC) > 70)
{
FloatingTextStringOnCreature("Heh...This trick is not for me!", oPC);
}
}


...

: Nov 22 2004, 10:49

OnPlayerDeath

CODE
void main()
{
object oPlayer = GetLastPlayerDied();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), GetLocation(oPlayer));

DelayCommand(6.0,AssignCommand(oPlayer,ClearAllActions()));
DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));
}


CODE
DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));


yes.gif
CODE
#include "nw_i0_plot"
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);
   int nGoldToTake =    FloatToInt(0.10 * GetGold(oDead));
   // * a cap of 10 000gp taken from you
   if (nGoldToTake > 10000)
   {
       nGoldToTake = 10000;
   }
   AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
   DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
   DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));

}
void main()
{
   object oRespawner = GetLastRespawnButtonPresser();
   AssignCommand(oRespawner,JumpToLocation(GetLocation(GetObjectByTag("WP_RAISE"))));
   ApplyPenalty(oRespawner);
   ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
   ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
   RemoveEffects(oRespawner);
}

... , good.gif

: [MoF]Darth_Nick Nov 24 2004, 04:57

smile.gif

Neverwinter Script Source
#include "aps_include"
void main()
{
object oPC = GetLastPlayerDied();
string sDeath = "UPDATE `reg_data` SET death=1 WHERE name='" + GetName(oPC) + "'";
string sDHelp = " , !";
PopUpDeathGUIPanel(oPC, TRUE, TRUE, 1, sDHelp);
SQLExecDirect(sDeath);
}

...

smile.gif
1: , ?
[mergetime]1101261601[/mergetime]
.. OnRespawn smile.gif , lol.gif lol.gif

: Ilharess Nov 24 2004, 12:40

/ ( , , , , , biggrin.gif ).

DAYTIMEGUARD string resref npc, ""
NIGHTTIMEGUARD string resref npc, ""
GATESGUARD string resref npc, ""
onhb :

Neverwinter Script Source
/*
door_guardspaw_5
Spawner for guards.
*/

//#include "kv_tools"
void main()
{
//--
string sDaytimeGuard = "MOB_DAYTIMEGUARD" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
object oDaytimeGuard = GetObjectByTag(sDaytimeGuard);
//--
string sNighttimeGuard = "MOB_NIGHTTIME" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
object oNighttimeGuard = GetObjectByTag(sNighttimeGuard);
//--
string sGatesGuard = "MOB_GATESGUARD" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
object oGatesGuard = GetObjectByTag(sGatesGuard);
//--Spawn day guard--//
if ( GetIsDay() && !GetIsObjectValid(oDaytimeGuard) && GetLocalString(OBJECT_SELF, "DAYTIMEGUARD") != "")

{
ActionOpenDoor(OBJECT_SELF);
object oNewGuard = CreateObject(OBJECT_TYPE_CREATURE, GetLocalString(OBJECT_SELF, "DAYTIMEGUARD"), GetLocation(OBJECT_SELF), 0, sDaytimeGuard);

/* if (GetIsObjectValid(oNewGuard))
{
DebugMessage(GetTag(OBJECT_SELF) + ": Guard " + sDaytimeGuard + " spawned sucsesfull");
}*/

//--Spawn Night Guard--//
} else if ( GetIsNight() && !GetIsObjectValid(oNighttimeGuard) && GetLocalString(OBJECT_SELF, "NIGHTTIMEGUARD") != "")
{
ActionOpenDoor(OBJECT_SELF);
object oNewGuard = CreateObject(OBJECT_TYPE_CREATURE, GetLocalString(OBJECT_SELF, "NIGHTTIMEGUARD"), GetLocation(OBJECT_SELF), 0, sNighttimeGuard);

/* if (GetIsObjectValid(oNewGuard))
{
DebugMessage(GetTag(OBJECT_SELF) + ": Guard " + sNighttimeGuard + " spawned sucsesfull");
}*/

//--Spawn Gate Guard--//
} else if ( GetIsDusk() && !GetIsObjectValid(oGatesGuard) && GetLocalString(OBJECT_SELF, "GATESGUARD") != "")
{
ActionOpenDoor(OBJECT_SELF);
object oNewGuard = CreateObject(OBJECT_TYPE_CREATURE, GetLocalString(OBJECT_SELF, "GATESGUARD"), GetLocation(OBJECT_SELF), 0, sGatesGuard);
/*if (GetIsObjectValid(oNewGuard))
{
DebugMessage(GetTag(OBJECT_SELF) + ": Guard " + sGatesGuard + " spawned sucsesfull");
}*/

}
//--
if (GetIsNight() && GetIsObjectValid(oDaytimeGuard))
{
SignalEvent(oDaytimeGuard, EventUserDefined(111));//TIME TO GO HOME:)
SetLocalObject(GetArea(OBJECT_SELF), "THE_DOOR", OBJECT_SELF);
}
else if (GetIsDay() && GetIsObjectValid(oNighttimeGuard))
{
SignalEvent(oNighttimeGuard, EventUserDefined(111));//TIME TO GO HOME:)
SetLocalObject(GetArea(OBJECT_SELF), "THE_DOOR", OBJECT_SELF);
}
else if (GetIsDawn() && GetIsObjectValid(oGatesGuard))
{
SignalEvent(oGatesGuard, EventUserDefined(111));//TIME TO GO HOME:)
SetLocalObject(GetArea(OBJECT_SELF), "THE_DOOR", OBJECT_SELF);
}
}


onopen
Neverwinter Script Source
/*
door_guardspaw_8
Spawner for guards.
*/


void main()
{

DelayCommand(5.0, ActionCloseDoor(OBJECT_SELF));
SetLocked(OBJECT_SELF, TRUE);
//--
object oClicker = GetLastOpenedBy();
if ( GetIsPC(oClicker)) return;
//--
string sDaytimeGuard = "MOB_DAYTIMEGUARD" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
//--
string sNighttimeGuard = "MOB_NIGHTTIME" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
//--
string sGatesGuard = "MOB_GATESGUARD" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
//--
if (GetTag(oClicker) == sDaytimeGuard || GetTag(oClicker) == sNighttimeGuard || GetTag(oClicker) == sGatesGuard)
{
DelayCommand(1.0, DestroyObject(oClicker));
}

}



onfailtoopen
Neverwinter Script Source
/*
door_guardspaw_4
Spawner for guards.
*/


void main()
{
//--
object oClicker = GetClickingObject();
if (GetIsPC(oClicker)) return;
//--
string sDaytimeGuard = "MOB_DAYTIMEGUARD" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
//--
string sNighttimeGuard = "MOB_NIGHTTIME" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
//--
string sGatesGuard = "MOB_GATESGUARD" + GetSubString(GetTag(OBJECT_SELF), 4, GetStringLength(GetTag(OBJECT_SELF)));
//--
if (GetTag(oClicker) == sDaytimeGuard || GetTag(oClicker) == sNighttimeGuard || GetTag(oClicker) == sGatesGuard)
{

AssignCommand(oClicker, SpeakString("*Ñòó÷èò â äâåðü*"));
DelayCommand(1.0, ActionOpenDoor(OBJECT_SELF));
DelayCommand(1.5, DestroyObject(oClicker));

}

}


userdef :
Neverwinter Script Source
//-- ondef --//
............................................
else if (nUser == 111) //TIME TO GO HOME:)
{

if ( !GetIsInCombat() || GetCurrentAction() != ACTION_DIALOGOBJECT)
{
ClearAllActions();
ActionMoveToObject(GetLocalObject(GetArea(OBJECT_SELF), "THE_DOOR"));
ActionOpenDoor(GetLocalObject(GetArea(OBJECT_SELF), "THE_DOOR"));
}
}


smile.gif
smile.gif DOOR_7 ( )

: Nov 27 2004, 12:29

, ....

QUOTE (baskan @ Nov 20 2004, 17:26)
, 1
: , PC , , , ? !

, . smile.gif

QUOTE ([MoF)
Darth_Nick, Nov 24 2004, 04:57]
1: , ?

2- ?
:

int iMax = - ;
int iValue = 20 ;// -
int iDiff=iMax-iSet; // -
int iSet = iMax-iDiff;

(iSet) PC
20 .

QUOTE ([MoF)
Darth_Nick, Nov 24 2004, 04:57]

...



... ? . ? ... , Web smile.gif , , - .

: Nov 29 2004, 09:35

--, Bioware. "Post game to Inernet", , (, ) , , , PHP , .
APS/NWNX2 MySQL. [MoF]Darth_Nick PHP MySQL.

:

-
- ( MoF]Darth_Nick' - , - . " PHP "
, :
-
-
-
-
- PC DM

:

OnModuleLoad

Neverwinter Script Source
/*
////////////////////////////////
//////Created By: Avaddon//////
//////Date: 28. 11. 2004//////
/////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\MYSQL SERVER STATUS\\\\\\\
\\\\\\Put this script:\\\\\\\\\
\\\\\\\"OnModuleLoad"\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/

#include "aps_include"
void main()
{
// "aps_onload"
SQLInit();

// MySQL " REG_DATA"
string sSQL="CREATE TABLE `reg_data` ("+
"  `pc_dm` varchar(64) NOT NULL default '',"+
"  `login` varchar(64) NOT NULL default '',"+
"  `name` varchar(64) NOT NULL default '',"+
"  `gender` varchar(10) NOT NULL default '',"+
"  `race` varchar(64) NOT NULL default '',"+
"  `sub_race` varchar(100) NOT NULL default '',"+
"  `levels` varchar(3) NOT NULL default '',"+
"  `class_1` varchar(64) NOT NULL default '',"+
"  `class_2` varchar(64) NOT NULL default '',"+
"  `class_3` varchar(64) NOT NULL default '',"+
"  `deity` varchar(100) NOT NULL default '',"+
"  `cd_key` varchar(64) NOT NULL default '',"+
"  `ip` varchar(25) NOT NULL default '',"+
"  `line_status`  varchar(4) NOT NULL default '',"+
"  `creation_date` datetime NOT NULL default '0000-00-00 00:00:00',"+
") TYPE=MyISAM;";

/* MySQL " line_status" "off", = "on".

. */

string sOffline = "UPDATE `reg_data` SET line_status = 'off' WHERE line_status='on'";

  // REG_DATA
  SQLExecDirect("DESCRIBE reg_data");

  // -
  if (SQLFetch()!= SQL_SUCCESS)
  {
    SQLExecDirect(sSQL);
  }
  // "Offline"
  SQLExecDirect(sOffline);
}



OnClientEnter

Neverwinter Script Source
/*
////////////////////////////////
//////Created By: Avaddon//////
//////Date: 28. 11. 2004//////
/////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\MYSQL SERVER STATUS\\\\\\\
\\\\\\Put this script:\\\\\\\\\
\\\\\\\"OnClentEnter"\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/

#include "aps_include"
void main()
{
object oPC=GetEnteringObject();
string sName=SQLEncodeSpecialChars(GetName(oPC));//
string sLogin=SQLEncodeSpecialChars(GetPCPlayerName(oPC)); //
string sGender=""; if(GetGender(oPC)==GENDER_FEMALE)sGender="";//
string sKey=GetPCPublicCDKey(oPC); //CD-key
string sIp=GetPCIPAddress(oPC); //Ip
string sDeity=GetDeity(oPC); //
string sPC_DM = "PC"; if (GetIsDM(oPC)==TRUE)sPC_DM = "DM";////
string sSubrace=GetStringLeft(GetSubRace(oPC), 99);//
string sAllLevels = IntToString(GetHitDice(oPC));
// ////////////////////////
string sRace;                                              //
int iRace = GetRacialType(oPC);                            //
switch (iRace)                                            //
    {                                                      //
    case RACIAL_TYPE_DWARF:                                //
    sRace = "";                                      //
    break;                                                //
                                                          //
    case RACIAL_TYPE_ELF:                                  //
    sRace = "";                                        //
    break;                                                //
                                                          //
    case RACIAL_TYPE_GNOME:                                //
    sRace = "";                                        //
    break;                                                //
                                                          //
    case RACIAL_TYPE_HALFELF:                              //
    sRace = "";                                    //
    break;                                                //
                                                          //
    case RACIAL_TYPE_HALFLING:                            //
    sRace = "";                                  //
    break;                                                //
                                                          //
    case RACIAL_TYPE_HALFORC:                              //
    sRace = "";                                    //
    break;                                                //
                                                          //
    case RACIAL_TYPE_HUMAN:                                //
    sRace = "";                                    //
    break;                                                //
    }                                                      //
/////////////////////////////////////////////////////////////


// ///////////////////////////////////////////
int iNum;                                  //
for (iNum=0; iNum<4; iNum++)
{
string sClass;                                          //
int iClass = GetClassByPosition(iNum,oPC);              //
switch (iClass)                                        //
    {                                                  //
    case CLASS_TYPE_ARCANE_ARCHER:                      //
    sClass = " ";                          //
    break;                                              //
                                                        //
    case CLASS_TYPE_ASSASSIN:                          //
    sClass = "";                                  //
    break;                                              //
                                                        //
    case CLASS_TYPE_BARBARIAN:                          //
    sClass = "";                                  //
    break;                                              //
                                                        //
    case CLASS_TYPE_BARD:                              //
    sClass = "";                                    //
    break;                                              //
                                                        //
    case CLASS_TYPE_BLACKGUARD:                        //
    sClass = " ";                              //
    break;                                              //
                                                        //
    case CLASS_TYPE_CLERIC:                            //
    sClass = "";                                  //
    break;                                              //
                                                        //
    case CLASS_TYPE_DIVINECHAMPION:                    //
    sClass = " ";                          //
    break;                                              //
                                                        //
    case CLASS_TYPE_DRAGONDISCIPLE:                    //
    sClass = " ";                          //
    break;                                              //
                                                        //
    case CLASS_TYPE_DRUID:                              //
    sClass = "";                                  //
    break;                                              //
                                                        //
    case CLASS_TYPE_DWARVENDEFENDER:                    //
    sClass = " ";                        //
    break;                                              //
                                                        //
    case CLASS_TYPE_FIGHTER:                            //
    sClass = "";                                    //
    break;                                              //
                                                        //
    case CLASS_TYPE_HARPER:                            //
    sClass = " ";                      //
    break;                                              //
                                                        //
    case CLASS_TYPE_INVALID:                            //
    sClass = " - ";                      //
    break;                                              //
                                                        //
    case CLASS_TYPE_MONK:                              //
    sClass = "";                                  //
    break;                                              //
                                                        //
    case CLASS_TYPE_PALADIN:                            //
    sClass = "";                                //
    break;                                              //
                                                        //
    case CLASS_TYPE_PALEMASTER:                        //
    sClass = " ";                          //
    break;                                              //
                                                        //
    case CLASS_TYPE_RANGER:                            //
    sClass = "";                                //
    break;                                              //
                                                        //
    case CLASS_TYPE_ROGUE:                              //
    sClass = "";                                    //
    break;                                              //
                                                        //
    case CLASS_TYPE_SHADOWDANCER:                      //
    sClass = " ";                            //
    break;                                              //
                                                        //
    case CLASS_TYPE_SHIFTER:                            //
    sClass = "";                              //
    break;                                              //
                                                        //
    case CLASS_TYPE_SORCERER:                          //
    sClass = "";                              //
    break;                                              //
                                                        //
    case CLASS_TYPE_WEAPON_MASTER:                      //
    sClass = " ";                          //
    break;                                              //
                                                        //
    case CLASS_TYPE_WIZARD:                            //
    sClass = "";                                    //
    break;                                              //
    }                                                  //
//////////////////////////////////////////////////////////

//
SetLocalString(oPC,"Class"+IntToString(iNum),sClass);//
//
SetLocalString(oPC,"Level"+IntToString(iNum),IntToString(GetLevelByPosition(iNum,oPC)));//;
}
// 1,2, 3 
string sLevel1 = GetLocalString(oPC,"Level1");
string sLevel2 = GetLocalString(oPC,"Level2");
string sLevel3 = GetLocalString(oPC,"Level3");

// 1,2, 3 
string sClass_1 = GetLocalString(oPC,"Class1")+" ("+sLevel1+")";
string sClass_2 = GetLocalString(oPC,"Class2")+" ("+sLevel2+")";
string sClass_3 = GetLocalString(oPC,"Class3")+" ("+sLevel3+")";


// SQL - - =
string sSelect = "SELECT * FROM `reg_data` WHERE login='"+GetPCPlayerName(oPC)+
"' AND name='" +GetName(oPC)+ "' AND pc_dm='"+sPC_DM+"'";

// MySQL " OnLine"
string sLine_Status = "UPDATE `reg_data` SET line_status = 'on' WHERE login='"+GetPCPlayerName(oPC)+
"' AND name='" +GetName(oPC)+ "' AND pc_dm='"+sPC_DM+"'";

// - , , -, , , (1,2,3), , -, ip,
string sReg="INSERT INTO reg_data (pc_dm, login, name, gender,"+
      "race, sub_race,levels, class_1,class_2,class_3, deity,cd_key,ip,line_status,creation_date) "+
      "VALUES('"+sPC_DM+
      "','"+sLogin+
      "','"+sName+
      "','"+sGender+
      "','"+sRace+
      "','"+sSubrace+
      "','"+sAllLevels+
      "','"+sClass_1+
      "','"+sClass_2+
      "','"+sClass_3+
      "','"+sDeity+
      "','"+sKey+
      "','"+sIp+
      "','on',NOW())";

// ( )
SQLExecDirect(sSelect);
if (SQLFirstRow() == SQL_SUCCESS)
    {
    SendMessageToPC(oPC," [On Line]");
    // - OnLine
    SQLExecDirect(sLine_Status);
    }
    else
    {
    // - , OnLine
        SQLExecDirect(sReg);
        SendMessageToPC(oPC," ! !");
        SendMessageToPC(oPC," [On Line]");
    }

//
SetLocalString(oPC,"Login",GetPCPlayerName(oPC));
SetLocalString(oPC,"Name",GetName(oPC));
}



OnClientLeave

Neverwinter Script Source
/*
////////////////////////////////
//////Created By: Avaddon//////
//////Date: 28. 11. 2004//////
/////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\MYSQL SERVER STATUS\\\\\\\
\\\\\\Put this script:\\\\\\\\\
\\\\\\\"OnClentLeave"\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/

#include "aps_include"
void main()
{
object oPC=GetExitingObject();

//
string sName=SQLEncodeSpecialChars(GetLocalString(oPC,"Name"));

//
string sLogin=SQLEncodeSpecialChars(GetLocalString(oPC,"Login"));
string sPC_DM = "PC"; if (GetIsDM(oPC)==TRUE)sPC_DM = "DM";////
//
// SQL - - =
string sSelect = "SELECT * FROM `reg_data` WHERE login='"+sLogin+
"' AND name='" +sName+ "' AND pc_dm='"+sPC_DM+"'";

// MySQL " "line_status" "off", = .
string sLine_Status = "UPDATE `reg_data` SET line_status = 'off' WHERE login='"+sLogin+
"' AND name='" +sName+ "' AND pc_dm='"+sPC_DM+"'";

SQLExecDirect(sSelect);
if (SQLFirstRow() == SQL_SUCCESS)
    {
    SendMessageToPC(oPC," [Off Line]");
    SQLExecDirect(sLine_Status);
    }
}


: Nov 29 2004, 10:11



OnPlayerLevelUp

Neverwinter Script Source
/*
////////////////////////////////
//////Created By: Avaddon//////
//////Date: 28. 11. 2004//////
/////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\MYSQL SERVER STATUS\\\\\\\
\\\\\\Put this script:\\\\\\\\\
\\\\\\\"OnPlayerLevelUp"\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/


#include "aps_include"
void main()
{
object oPC = GetPCLevellingUp();
string sAllLevels = IntToString(GetHitDice(oPC));
// ///////////////////////////////////////////
int iNum;   //
for (iNum=0; iNum<4; iNum++)
{
string sClass; //
int iClass = GetClassByPosition(iNum,oPC); //
switch (iClass)   //
{   //
case CLASS_TYPE_ARCANE_ARCHER: //
sClass = " "; //
break; //
//
case CLASS_TYPE_ASSASSIN:   //
sClass = ""; //
break; //
//
case CLASS_TYPE_BARBARIAN: //
sClass = ""; //
break; //
//
case CLASS_TYPE_BARD:   //
sClass = ""; //
break; //
//
case CLASS_TYPE_BLACKGUARD:   //
sClass = " "; //
break; //
//
case CLASS_TYPE_CLERIC:   //
sClass = ""; //
break; //
//
case CLASS_TYPE_DIVINECHAMPION:   //
sClass = " ";   //
break; //
//
case CLASS_TYPE_DRAGONDISCIPLE:   //
sClass = " "; //
break; //
//
case CLASS_TYPE_DRUID: //
sClass = "";   //
break; //
//
case CLASS_TYPE_DWARVENDEFENDER: //
sClass = " "; //
break; //
//
case CLASS_TYPE_FIGHTER: //
sClass = ""; //
break; //
//
case CLASS_TYPE_HARPER:   //
sClass = " "; //
break; //
//
case CLASS_TYPE_INVALID: //
sClass = " - ";   //
break; //
//
case CLASS_TYPE_MONK:   //
sClass = "";   //
break; //
//
case CLASS_TYPE_PALADIN: //
sClass = "";   //
break; //
//
case CLASS_TYPE_PALEMASTER:   //
sClass = " "; //
break; //
//
case CLASS_TYPE_RANGER:   //
sClass = ""; //
break; //
//
case CLASS_TYPE_ROGUE: //
sClass = ""; //
break; //
//
case CLASS_TYPE_SHADOWDANCER:   //
sClass = " ";   //
break; //
//
case CLASS_TYPE_SHIFTER: //
sClass = "";   //
break; //
//
case CLASS_TYPE_SORCERER:   //
sClass = "";   //
break; //
//
case CLASS_TYPE_WEAPON_MASTER: //
sClass = " ";   //
break; //
//
case CLASS_TYPE_WIZARD:   //
sClass = "";   //
break; //
}   //
SetLocalString(oPC,"Class"+IntToString(iNum),sClass);
SetLocalString(oPC,"Level"+IntToString(iNum),IntToString(GetLevelByPosition(iNum,oPC)));//;
//////////////////////////////////////////////////////////
}
string sName=SQLEncodeSpecialChars(GetName(oPC));
string sLogin=SQLEncodeSpecialChars(GetPCPlayerName(oPC));
// 1,2, 3
string sLevel1 = GetLocalString(oPC,"Level1");
string sLevel2 = GetLocalString(oPC,"Level2");
string sLevel3 = GetLocalString(oPC,"Level3");

// 1,2, 3
string sClass_1 = GetLocalString(oPC,"Class1")+" ("+sLevel1+")";
string sClass_2 = GetLocalString(oPC,"Class2")+" ("+sLevel2+")";
string sClass_3 = GetLocalString(oPC,"Class3")+" ("+sLevel3+")";

// MySQL " "
string sLevel = "UPDATE `reg_data` SET levels = '"+sAllLevels+
"', class_1 = '"+sClass_1+
"', class_2 = '"+sClass_2+
"', class_3 = '"+sClass_3+
"' WHERE login = '"+sLogin+"' AND name = '"+sName+"'";

SQLExecDirect(sLevel);
}


PHP- by [MoF]Darth_Nick
,

. .

: Dec 4 2004, 23:45

, .
, .
, ?

1. http://cgi.nwvault.ign.com/dtracker.cgi?file=HAKPACKS_1041513631913&url=http://vnfiles.ign.com/nwn/hakpacks/Adam_Miller1041513631913bed%2Ezip, , , .

2. . "free". , free_inn_rooms.
, . "BED" "SLEEP".

3. , .
, , . . , - , . - , Slow, . , . .

OnPlayerRest .

Neverwinter Script Source
/*
////////////////////////////////
//////Created By: Avaddon//////
//////Date: 04. 12. 2004//////
/////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\INN ROOM FREE REST\\\\\\\
\\\\\\Put this script:\\\\\\\\\
\\\\\\\"OnPlayerRest"\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/

void main()
{
//
effect eBlack = EffectVisualEffect(VFX_DUR_BLACKOUT);
effect eZzz =  EffectVisualEffect(VFX_IMP_SLEEP);
effect eSlow = EffectSlow();

object oPC = GetLastPCRested();

// "BED"
object oBed = GetNearestObjectByTag("BED",oPC);

/* "SLEEP"
( nwvault.ign.com)*/

object oSleep = GetNearestObjectByTag("SLEEP",oPC);

//
object oArmor =GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
object oLeftHand = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
object oBoots = GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC);
object oHelmet = GetItemInSlot(INVENTORY_SLOT_HEAD,oPC);
object oBelt = GetItemInSlot(INVENTORY_SLOT_BELT,oPC);
object oCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC);
object oArms = GetItemInSlot(INVENTORY_SLOT_ARMS,oPC);

//
string sFree = GetTag(GetArea(oPC));
string sArmor = GetLocalString(oPC,"armor");
string sRightHand = GetLocalString(oPC,"right");
string sLeftHand = GetLocalString(oPC,"left");
string sHelmet = GetLocalString(oPC,"helmet");
string sBoots = GetLocalString(oPC,"boots");
string sBelt = GetLocalString(oPC,"belt");
string sCloak = GetLocalString(oPC,"cloak");
string sArms = GetLocalString(oPC,"arms");

    /* .
    "free" ( "free_inn_rooms"),
    */

    if(GetStringLeft(sFree,4)=="free")
    {
    // ...
        if(GetLocalInt(GetLastPCRested(),"on_bed")!=1)
        {
        //
        SetLocalString(oPC,"armor",GetTag(oArmor));
        SetLocalString(oPC,"right",GetTag(oRightHand));
        SetLocalString(oPC,"left",GetTag(oLeftHand));
        SetLocalString(oPC,"helmet",GetTag(oHelmet));
        SetLocalString(oPC,"boots",GetTag(oBoots));
        SetLocalString(oPC,"belt",GetTag(oBelt));
        SetLocalString(oPC,"cloak",GetTag(oCloak));
        SetLocalString(oPC,"arms",GetTag(oArms));

        /* 2 (
        . . ,
        , .*/

        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oArmor)));
        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oRightHand)));
        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oLeftHand)));
        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oHelmet)));
        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oBoots)));
        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oBelt)));
        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oCloak)));
        DelayCommand(2.0,AssignCommand(oPC,ActionUnequipItem(oArms)));

            // ( )...
            if (GetLastRestEventType()==REST_EVENTTYPE_REST_STARTED)
            {
            //
            AssignCommand(oPC,ClearAllActions());

            // ( - )
            AssignCommand(oPC,ActionMoveToObject(oBed));

            // -
            DelayCommand(2.0,AssignCommand(oPC,ActionJumpToObject(oSleep)));

            // " "
            DelayCommand(2.5,SetLocalInt(oPC,"on_bed",1));

            //
            DelayCommand(3.0,AssignCommand(oPC,ActionRest()));

            //
            DelayCommand(3.5,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eZzz,oPC,10.0));
            DelayCommand(4.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBlack,oPC,60.0));
            }// " "
        }// " "
    }// " 'free' "
    else
    {
    /* -
    "free".
    "AssignCommand(oPC,ClearAllActions()" - . ,
    , ,
    .*/

    AssignCommand(oPC,ClearAllActions());
    }

  //////////////////////////////////////////////////////////////////////
  /* "free"
  .*/
/////////////////////////////////////

    if(GetStringLeft(sFree,4)=="free" && GetLocalInt(oPC,"on_bed")==1)
    {
        //
        if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
        {
        // ( )
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sArmor), INVENTORY_SLOT_CHEST)));
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sRightHand), INVENTORY_SLOT_RIGHTHAND)));
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sLeftHand), INVENTORY_SLOT_LEFTHAND)));
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sBoots), INVENTORY_SLOT_BOOTS)));
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sHelmet), INVENTORY_SLOT_HEAD)));
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sBelt), INVENTORY_SLOT_BELT)));
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sCloak), INVENTORY_SLOT_CLOAK)));
        DelayCommand(2.0,AssignCommand(oPC, ActionEquipItem(GetItemPossessedBy(oPC,sArms), INVENTORY_SLOT_ARMS)));

        //
        AssignCommand(oPC,ActionJumpToObject(oBed));

        // .
        DeleteLocalInt(oPC,"on_bed");
        DeleteLocalString(oPC,"armor");
        DeleteLocalString(oPC,"right");
        DeleteLocalString(oPC,"left");
        DeleteLocalString(oPC,"helmet");
        DeleteLocalString(oPC,"boots");
        DeleteLocalString(oPC,"belt");
        DeleteLocalString(oPC,"cloak");
        DeleteLocalString(oPC,"arms");

        //
        RemoveEffect(oPC,eBlack);
        }// "

        /* ( ,
        .. .*/

        if (GetLastRestEventType()==REST_EVENTTYPE_REST_CANCELLED)
        {
        //
        AssignCommand(oPC,ActionJumpToObject(oBed));

        // .
        DeleteLocalInt(oPC,"on_bed");
        DeleteLocalString(oPC,"armor");
        DeleteLocalString(oPC,"right");
        DeleteLocalString(oPC,"left");
        DeleteLocalString(oPC,"helmet");
        DeleteLocalString(oPC,"boots");
        DeleteLocalString(oPC,"belt");
        DeleteLocalString(oPC,"cloak");
        DeleteLocalString(oPC,"arms");

        /*
        Blackout ,
        30 .*/


        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eSlow,oPC,30.0);
        //
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eZzz,oPC,10.0);
        DelayCommand(10.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eZzz,oPC,10.0));
        DelayCommand(20.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eZzz,oPC,10.0));
        }
    }
}

: Twin Dec 7 2004, 11:38


. ( ) , . ( On Monster Hit) . .
:
.
Additional Price ResRef'.
On Monster Hit ( Creature Weapon) , . (SubType) . , ? ;)
X uses/day. , - .
- , .

Neverwinter Script Source
/*
** z .
*/

string GetProperties(object oItem)
{
    string sProperties = IntToString(GetItemCharges(oItem));
    int nTemp;
    itemproperty ipTemp = GetFirstItemProperty(oItem);

    while (GetIsItemPropertyValid(ipTemp))
    {
        if (GetItemPropertyDurationType(ipTemp) == 2)
        {
            sProperties += "@"+
                IntToString(GetItemPropertyType(ipTemp)) +":";

            nTemp = GetItemPropertyParam1Value(ipTemp);
            if (nTemp == 255 || nTemp == -1)
                sProperties += "-1:";
            else
                sProperties += IntToString(nTemp - 1) +":";

            sProperties +=
                IntToString(GetItemPropertyCostTable(ipTemp)) +":";

            nTemp = GetItemPropertyCostTableValue(ipTemp);
            if (nTemp == -1)
                sProperties += "-1:";
            else
                sProperties += IntToString(nTemp - 1) +":";

            nTemp = GetItemPropertySubType(ipTemp);
            if (nTemp == -1) sProperties += "0";
            else            sProperties += IntToString(nTemp);
        }

        ipTemp = GetNextItemProperty(oItem);
    }

    return sProperties;
}

/*
** .
*/

void SetProperties(object oItem, string sProperties)
{
    //SendMessageToPC(GetFirstPC(), "SetProperties :: sProperties == "+ sProperties);

    itemproperty ipTemp = GetFirstItemProperty(oItem);
    while (GetIsItemPropertyValid(ipTemp))
    {
        RemoveItemProperty(oItem, ipTemp);
        ipTemp = GetNextItemProperty(oItem);
    }

    int i = 1;
    int pos, nCharges;
    string sTemp;

    nCharges = StringToInt(GetStringLeft(sProperties, FindSubString(sProperties, "@")));
    if (nCharges > 0)
        SetItemCharges(oItem, nCharges);

    while ((pos = FindSubString(sProperties, "@")) != -1)
    {
        sProperties = GetStringRight(sProperties, GetStringLength(sProperties) - pos - 1);

        pos = FindSubString(sProperties, "@");
        if (pos == -1)
            pos = GetStringLength(sProperties);

        sTemp = GetStringLeft(sProperties, pos);

        //SendMessageToPC(GetFirstPC(), "sTemp["+ IntToString(i) +"] == "+ sTemp);
        SetProperty(oItem, sTemp);

        i++;
    }
}

void SetProperty(object oItem, string sProperty)
{
    int pos = FindSubString(sProperty, ":");
    int nType = StringToInt(GetSubString(sProperty, 0, pos));

    sProperty = GetSubString(sProperty, pos + 1, GetStringLength(sProperty));
    pos = FindSubString(sProperty, ":");
    int nParam1Value = StringToInt(GetSubString(sProperty, 0, pos));
    nParam1Value++;

    sProperty = GetSubString(sProperty, pos + 1, GetStringLength(sProperty));
    pos = FindSubString(sProperty, ":");
    int nCostTable = StringToInt(GetSubString(sProperty, 0, pos));

    sProperty = GetSubString(sProperty, pos + 1, GetStringLength(sProperty));
    pos = FindSubString(sProperty, ":");
    int nCostTableValue = StringToInt(GetSubString(sProperty, 0, pos));
    nCostTableValue++;

    sProperty = GetSubString(sProperty, pos + 1, GetStringLength(sProperty));
    int nSubType = StringToInt(sProperty);

    itemproperty ipTemp;

    switch (nType)
    {
/*OK*/  case ITEM_PROPERTY_ABILITY_BONUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ABILITY_BONUS _OK_");
            ipTemp = ItemPropertyAbilityBonus(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_AC_BONUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_AC_BONUS _OK_");
            ipTemp = ItemPropertyACBonus(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP _OK_");
            ipTemp = ItemPropertyACBonusVsAlign(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE _OK_");
            ipTemp = ItemPropertyACBonusVsDmgType(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP _OK_");
            ipTemp = ItemPropertyACBonusVsRace(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT _OK_");
            ipTemp = ItemPropertyACBonusVsSAlign(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ARCANE_SPELL_FAILURE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ARCANE_SPELL_FAILURE _OK_");
            ipTemp = ItemPropertyArcaneSpellFailure(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ATTACK_BONUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ATTACK_BONUS _OK_");
            ipTemp = ItemPropertyAttackBonus(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP _OK_");
            ipTemp = ItemPropertyAttackBonusVsAlign(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP _OK_");
            ipTemp = ItemPropertyAttackBonusVsRace(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT _OK_");
            ipTemp = ItemPropertyAttackBonusVsSAlign(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION _OK_");
            ipTemp = ItemPropertyWeightReduction(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_BONUS_FEAT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_BONUS_FEAT _OK_");
            ipTemp = ItemPropertyBonusFeat(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N _OK_");
            ipTemp = ItemPropertyBonusLevelSpell(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_CAST_SPELL:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_CAST_SPELL _OK_");
            ipTemp = ItemPropertyCastSpell(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DAMAGE_BONUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DAMAGE_BONUS _OK_");
            ipTemp = ItemPropertyDamageBonus(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP _OK_");
            ipTemp = ItemPropertyDamageBonusVsAlign(nSubType, nParam1Value, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP _OK_");
            ipTemp = ItemPropertyDamageBonusVsRace(nSubType, nParam1Value, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT _OK_");
            ipTemp = ItemPropertyDamageBonusVsSAlign(nSubType, nParam1Value, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DAMAGE_REDUCTION:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DAMAGE_REDUCTION _OK_");
            ipTemp = ItemPropertyDamageReduction(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DAMAGE_RESISTANCE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DAMAGE_RESISTANCE _OK_");
            ipTemp = ItemPropertyDamageResistance(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DAMAGE_VULNERABILITY:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DAMAGE_VULNERABILITY _OK_");
            ipTemp = ItemPropertyDamageVulnerability(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DARKVISION:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DARKVISION _OK_");
            ipTemp = ItemPropertyDarkvision();
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_ABILITY_SCORE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_ABILITY_SCORE _OK_");
            ipTemp = ItemPropertyDecreaseAbility(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_AC:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_AC _OK_");
            ipTemp = ItemPropertyDecreaseAC(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER _OK_");
            ipTemp = ItemPropertyAttackPenalty(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_DAMAGE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_DAMAGE _OK_");
            ipTemp = ItemPropertyDamagePenalty(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER _OK_");
            ipTemp = ItemPropertyEnhancementPenalty(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_SAVING_THROWS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_SAVING_THROWS _OK_");
            ipTemp = ItemPropertyReducedSavingThrowVsX(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC _OK_");
            ipTemp = ItemPropertyReducedSavingThrow(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_DECREASED_SKILL_MODIFIER:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_DECREASED_SKILL_MODIFIER _OK_");
            ipTemp = ItemPropertyDecreaseSkill(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT _OK_");
            ipTemp = ItemPropertyContainerReducedWeight(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ENHANCEMENT_BONUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ENHANCEMENT_BONUS _OK_");
            ipTemp = ItemPropertyEnhancementBonus(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP _OK_");
            ipTemp = ItemPropertyEnhancementBonusVsAlign(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP _OK_");
            ipTemp = ItemPropertyEnhancementBonusVsRace(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT ?_OK_");
            ipTemp = ItemPropertyEnhancementBonusVsSAlign(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE _OK_");
            ipTemp = ItemPropertyExtraMeleeDamageType(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE _OK_");
            ipTemp = ItemPropertyExtraRangeDamageType(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_FREEDOM_OF_MOVEMENT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_FREEDOM_OF_MOVEMENT _OK_");
            ipTemp = ItemPropertyFreeAction();
            break;
/*OK*/  case ITEM_PROPERTY_HASTE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_HASTE _OK_");
            ipTemp = ItemPropertyHaste();
            break;
/*OK*/  case ITEM_PROPERTY_HEALERS_KIT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_HEALERS_KIT _OK_");
            ipTemp = ItemPropertyHealersKit(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_HOLY_AVENGER:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_HOLY_AVENGER _OK_");
            ipTemp = ItemPropertyHolyAvenger();
            break;
/*OK*/  case ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE _OK_");
            ipTemp = ItemPropertyDamageImmunity(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS _OK_");
            ipTemp = ItemPropertyImmunityMisc(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL _OK_");
            ipTemp = ItemPropertySpellImmunitySpecific(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL _OK_");
            ipTemp = ItemPropertySpellImmunitySchool(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL _OK_");
            ipTemp = ItemPropertyImmunityToSpellLevel(nCostTableValue+1);
            break;
/*OK*/  case ITEM_PROPERTY_IMPROVED_EVASION:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_IMPROVED_EVASION _OK_");
            ipTemp = ItemPropertyImprovedEvasion();
            break;
/*OK*/  case ITEM_PROPERTY_KEEN:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_KEEN _OK_");
            ipTemp = ItemPropertyKeen();
            break;
/*OK*/  case ITEM_PROPERTY_LIGHT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_LIGHT _OK_");
            ipTemp = ItemPropertyLight(nCostTableValue, nParam1Value);
            break;
/*OK*/  case ITEM_PROPERTY_MASSIVE_CRITICALS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_MASSIVE_CRITICALS _OK_");
            ipTemp = ItemPropertyMassiveCritical(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_MIGHTY:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_MIGHTY _OK_");
            ipTemp = ItemPropertyMaxRangeStrengthMod(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_MIND_BLANK:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_MIND_BLANK");
            break;
/*OK*/  case ITEM_PROPERTY_MONSTER_DAMAGE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_MONSTER_DAMAGE ?OK?");
            ipTemp = ItemPropertyMonsterDamage(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_NO_DAMAGE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_NO_DAMAGE _OK_");
            ipTemp = ItemPropertyNoDamage();
            break;
/*OK*/  case ITEM_PROPERTY_ON_HIT_PROPERTIES:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ON_HIT_PROPERTIES _OK_");
            ipTemp = ItemPropertyOnHitProps(nSubType, nCostTableValue, nParam1Value);
            break;
/*FAIL*/case ITEM_PROPERTY_ON_MONSTER_HIT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ON_MONSTER_HIT _PARTIAL_ "+ IntToString(nSubType) +"!"+ IntToString(nParam1Value));
            ipTemp = ItemPropertyOnMonsterHitProperties(nSubType, nParam1Value);
            break;
/*OK*/  case ITEM_PROPERTY_ONHITCASTSPELL:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_ONHITCASTSPELL _OK_");
            ipTemp = ItemPropertyOnHitCastSpell(nSubType, nCostTableValue+1);
            break;
/*OK*/  case ITEM_PROPERTY_POISON:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_POISON");
            break;
/*OK*/  case ITEM_PROPERTY_REGENERATION:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_REGENERATION _OK_");
            ipTemp = ItemPropertyRegeneration(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_REGENERATION_VAMPIRIC:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_REGENERATION_VAMPIRIC _OK_");
            ipTemp = ItemPropertyVampiricRegeneration(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_SAVING_THROW_BONUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_SAVING_THROW_BONUS _OK_");
            ipTemp = ItemPropertyBonusSavingThrowVsX(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC _OK_");
            ipTemp = ItemPropertyBonusSavingThrow(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_SKILL_BONUS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_SKILL_BONUS _OK_");
            ipTemp = ItemPropertySkillBonus(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_SPECIAL_WALK:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_SPECIAL_WALK ?OK?");
            ipTemp = ItemPropertySpecialWalk(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_SPELL_RESISTANCE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_SPELL_RESISTANCE _OK_");
            ipTemp = ItemPropertyBonusSpellResistance(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_THIEVES_TOOLS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_THIEVES_TOOLS _OK_");
            ipTemp = ItemPropertyThievesTools(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_TRAP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_TRAP _OK_");
            ipTemp = ItemPropertyTrap(nSubType, nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_TRUE_SEEING:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_TRUE_SEEING _OK_");
            ipTemp = ItemPropertyTrueSeeing();
            break;
/*OK*/  case ITEM_PROPERTY_TURN_RESISTANCE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_TURN_RESISTANCE _OK_");
            ipTemp = ItemPropertyTurnResistance(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_UNLIMITED_AMMUNITION:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_UNLIMITED_AMMUNITION _OK_");
            ipTemp = ItemPropertyUnlimitedAmmo(nCostTableValue);
            break;
/*OK*/  case ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP _OK_");
            ipTemp = ItemPropertyLimitUseByAlign(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_USE_LIMITATION_CLASS:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_USE_LIMITATION_CLASS _OK_");
            ipTemp = ItemPropertyLimitUseByClass(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE _OK_");
            ipTemp = ItemPropertyLimitUseByRace(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT _OK_");
            ipTemp = ItemPropertyLimitUseBySAlign(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_USE_LIMITATION_TILESET:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_USE_LIMITATION_TILESET");
            break;
/*OK*/  case ITEM_PROPERTY_VISUALEFFECT:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_VISUALEFFECT _OK_");
            ipTemp = ItemPropertyVisualEffect(nSubType);
            break;
/*OK*/  case ITEM_PROPERTY_WEIGHT_INCREASE:
            //SendMessageToPC(GetFirstPC(), "const ITEM_PROPERTY_WEIGHT_INCREASE _OK_");
            ipTemp = ItemPropertyWeightIncrease(nParam1Value);
            break;
        default:
            //SendMessageToPC(GetFirstPC(), "const default");
            break;
    }

    if (GetIsItemPropertyValid(ipTemp)) {
        AddItemProperty(DURATION_TYPE_PERMANENT, ipTemp, oItem);
    }
}

. .

: Tarre Talliorne Jan 5 2005, 13:19

http://rage-t.boom.ru/creative.html
. .

: Jan 27 2005, 21:00

, OnClientEnter ....... . _kaa_ baal , . .
, , , smile.gif . oBook, ,
object oBook=GetItemPossessedBy(oPC, "item004");

:

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: module_enter
//:://////////////////////////////////////////////
/* system OnClientEnter
*/

//:://////////////////////////////////////////////
//:: Created By: _kaa_ , Baal , Ëèòî
//:: Created On: Jan 27, 2005
//:://////////////////////////////////////////////
#include "nw_o0_itemmaker"
void main()
{
object oPC = GetEnteringObject();
object oStore = GetModule();
string sStoreName = GetName(oPC)+GetPCPlayerName(oPC); // =[PC name] + [login name]
SetLocalString(oPC,"HP_MyIdString",sStoreName); // Çàãðóçêà õèò ïîèíòîâ è ñïåëëîâ
int iSavedHP = GetLocalInt(oStore,sStoreName);
if (iSavedHP != 0)
{
effect efDamage = EffectDamage(GetMaxHitPoints(oPC)-iSavedHP,DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_ENERGY);
ApplyEffectToObject(DURATION_TYPE_INSTANT,efDamage,oPC);
}

int k,j,nSpells;
for (k=1; k < 510; k++)
{
nSpells = GetLocalArrayInt(oStore,sStoreName+"_spells",k);
if (nSpells)
for (j=0; j <= GetHasSpell(k,oPC)-nSpells; j++) DecrementRemainingSpellUses(oPC, k);
if(GetIsDM(oPC)) //Åñëè DM, òî íå âûäàâàòü ñòàðòîâûé ïàêåò
return;
object oBook=GetItemPossessedBy(oPC, "item004");
if(!GetIsObjectValid(oBook)) //Åñëè äîñòóïåí ïðåäìåò ñ ResRef*îì "item004",
//íå âûäàâàòü ñòàðòîâûé ïàêåò, åñëè íå äîñòóïåí, òî óíè÷òîæèòü âñå âåùè â èíâåíòàðå
{
object oItem = GetFirstItemInInventory (oPC);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory (oPC);
}
int i=0;
while(i<14)
{
DestroyObject(GetItemInSlot(i, oPC));
i++;
}
if(GetLevelByClass(CLASS_TYPE_FIGHTER, oPC)) //Âûäà÷à íà÷àëüíîãî ïàêåòà ïî êëàññó
{
GiveGoldToCreature(oPC, 500);
CreateItemOnObject("item004", oPC); //Âûäà÷à âåùåé ïî ResRef*àì
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC))
{
GiveGoldToCreature(oPC, 500);
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_MONK, oPC))
{
GiveGoldToCreature(oPC, 500);
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_RANGER, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_WIZARD, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_SORCERER, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_BARD, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_DRUID, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_BARD, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_CLERIC, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_PALADIN, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
else if(GetLevelByClass(CLASS_TYPE_ROGUE, oPC))
{
CreateItemOnObject("item004", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("Item", oPC);
CreateItemOnObject("item001", oPC);
CreateItemOnObject("item003", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
CreateItemOnObject("it_mpotion004", oPC);
}
}
}
}


(_kaa_) OnClientLeave

Neverwinter Script Source
#include "nw_o0_itemmaker"
void main()
{
object oPC = GetExitingObject();
object oStore = GetModule();
string sStoreName = GetLocalString(oPC,"HP_MyIdString");
SetLocalInt(oStore, sStoreName, GetCurrentHitPoints(oPC));
int k,nSpells;
for (k=1;k<510;k++)
{
nSpells = GetHasSpell(k,oPC);
if (nSpells)
SetLocalArrayInt(oStore,sStoreName+"_spells",k,nSpells);
}
}

: Lex Jan 27 2005, 22:14

. , . 250 .

"low_plc_loot" - .

Neverwinter Script Source
//::Created by
//::Modificated by Lex
void Clear(object oBag = OBJECT_SELF)
{
object oItem = GetFirstItemInInventory(oBag);
while (GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oBag);
}
DestroyObject(oBag,1.0);
}
void main()
{
string sTemplate = "low_plc_loot";
string sTag = GetTag(OBJECT_SELF);
location lLoc = GetLocation(OBJECT_SELF);
object oloot = CreateObject(OBJECT_TYPE_PLACEABLE, sTemplate, lLoc, TRUE, sTag);
int i = 0;
object oItem = GetFirstItemInInventory(OBJECT_SELF);
while (GetIsObjectValid(oItem))
{
if (GetDroppableFlag(oItem))
CopyObject(oItem,lLoc,oloot);
DestoyObject(oItem);
oItem = GetNextItemInInventory(OBJECT_SELF);
}
oItem = GetItemInSlot(i,OBJECT_SELF);
while (i<14)
{
if (GetDroppableFlag(oItem))
CopyObject(oItem,lLoc,oloot);
DestoyObject(oItem);
i++;
oItem = GetItemInSlot(i,OBJECT_SELF);
}
AssignCommand(oloot,DelayCommand(250.0,Clear(oloot)));
}

: Aiwan Mar 13 2005, 20:25

.
, 10 . ? , 10, . .
, 15 . . .

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG!  www.wrg.ru
//:: am_pc_stinki_go2
//:://////////////////////////////////////////////
/*
  ,
    oPC (!)

*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan    Aiwan@e-mail.ru
//:: Created On: 20.03.2004
//:://////////////////////////////////////////////
void main()
{
    object oPC = GetPCSpeaker();
    object oStinki = GetObjectByTag("MM_STINKI");
    object oWp01 = GetObjectByTag("WP_STINKI_01");
    object oWp02 = GetObjectByTag("WP_STINKI_02");
    object oWp03 = GetObjectByTag("WP_STINKI_03");
    object oWp04 = GetObjectByTag("WP_STINKI_04");
    object oWp05 = GetObjectByTag("WP_STINKI_05");
    object oWp06 = GetObjectByTag("WP_STINKI_06");
    object oWp07 = GetObjectByTag("WP_STINKI_07");
    object oWp08 = GetObjectByTag("WP_STINKI_08");
    object oWp09 = GetObjectByTag("WP_STINKI_09");
    object oWp10 = GetObjectByTag("WP_STINKI_10");
    object oWp11 = GetObjectByTag("WP_STINKI_11");
    object oDoor = GetObjectByTag("AM_DOOR_FLEG_NO");
    effect eHaste = EffectHaste(); // !

    SetLocalInt(oPC, "STINKI", 3);
    AssignCommand(oStinki, ActionPauseConversation());
    AssignCommand(oPC, ActionForceFollowObject(oStinki, 4.0f));
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHaste, oPC, 9999.0);
    AssignCommand(oStinki, ActionDoCommand(SetCommandable(FALSE, oPC)));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp02, TRUE, 4.0));
    AssignCommand(oStinki, ActionDoCommand(SetFacingPoint(GetPosition(oPC))));
    AssignCommand(oStinki, ActionDoCommand(SpeakString(" !")));
    AssignCommand(oStinki, ActionWait(1.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp03, TRUE, 4.0));
    AssignCommand(oStinki, ActionWait(2.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp04, TRUE, 4.0));
    AssignCommand(oStinki, ActionDoCommand(SetFacingPoint(GetPosition(oPC))));
    AssignCommand(oStinki, ActionDoCommand(SpeakString(" ?")));
    AssignCommand(oStinki, ActionWait(2.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp05, TRUE, 4.0));
    AssignCommand(oStinki, ActionWait(2.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oDoor, TRUE, 4.0));
    AssignCommand(oStinki, ActionDoCommand(SpeakString(" , .")));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp06, TRUE, 4.0));
    AssignCommand(oStinki, ActionWait(2.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp07, TRUE, 4.0));
    AssignCommand(oStinki, ActionWait(2.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp08, TRUE, 1.0));
    AssignCommand(oStinki, ActionDoCommand(SpeakString(" !")));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp09, TRUE, 1.0));
    AssignCommand(oStinki, ActionWait(2.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp10, TRUE, 1.0));
    AssignCommand(oStinki, ActionWait(2.0));
    AssignCommand(oStinki, ActionForceMoveToObject(oWp11, TRUE, 1.0));
    AssignCommand(oStinki, ActionDoCommand(SetFacingPoint(GetPosition(oPC))));
    AssignCommand(oStinki, ActionDoCommand(RemoveEffect(oPC, eHaste)));
    AssignCommand(oStinki, ActionDoCommand(SetCommandable(TRUE, oPC)));
    AssignCommand(oStinki, ActionResumeConversation());
}

: Lex Mar 17 2005, 11:51

" "
" LEX'"


:
2 ( ) .
(, . .)
:
2 , . , .

"+" - . ( , .) .
"-" - . .

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: Name lm_2speakers
//:: Copyright 2004 -=WRG!=-
//:://////////////////////////////////////////////
/*
2- . .
*/

//:://////////////////////////////////////////////
//:: Created By: Lex
//:: Created On: Agust 2004
//:://////////////////////////////////////////////

void ANIMATION(object oD)
/// . .
{
int A=0;
float T,S;
switch (Random(8)+1)
{
case 2: A=ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD;T=3.0;S=1.0;break;
case 3: A=ANIMATION_FIREFORGET_TAUNT;T=3.0;S=1.0;break;
case 4: A=ANIMATION_FIREFORGET_PAUSE_BORED;S=1.0;break;
case 5: A=ANIMATION_LOOPING_LISTEN;T=5.0;S=1.0;break;
case 6: A=ANIMATION_LOOPING_LISTEN;T=5.0;S=1.0;break;
}
if (A==0) return;
AssignCommand(oD,PlayAnimation(A,S,T));
}

void DIALOG(object oD1,object oD2)
{
string s1="",s2="";
string ya = GetName(GetObjectByTag("ya")); // "+ya+"
switch (Random(30))
{
case 0: s1=" , ?";s2=" ..";break;
case 1: s1=" ? "+ya+"?";s2=" ! "+ya+" !";break;
/// 20 -
}
AssignCommand(oD1,SpeakString(s1)); ///
AssignCommand(oD2,DelayCommand(5.0,SpeakString(s2))); ///
}

void main()
{
object oPC = GetFirstPC();
if (GetArea(oPC)!=GetArea(OBJECT_SELF)) return; // ,
object oD1 = GetNearestObjectByTag("SPEAKING_NPC_1"); //
object oD2 = GetNearestObjectByTag("SPEAKING_NPC_1"); //
if (GetIsInCombat(oD1)) return; //
if (GetIsInCombat(oD2)) return; //
if ( (IsInConversation(oD1)) || (IsInConversation(oD2)) ) return; ///
if (GetDistanceToObject(oPC)>10.0) return; // ( 10 ) .
AssignCommand(oD1,SetFacingPoint(GetPosition(oD2))); //
AssignCommand(oD2,SetFacingPoint(GetPosition(oD1)));
DIALOG(oD1,oD2);
ANIMATION(oD1);
ANIMATION(oD2);
}



================================================================================

onDamage . ( "DANGER")

, . , . , .
: 5 . .... .
, ,
KeyTag. . .
( KeyTaG:
. . .
: , KeyTaG .)
KeyTag : X_Y
X - . 2
1 -
2 -
3 -
Y - . ( 9). 5 .
30%.
Neverwinter Script Source
//::///////////////////////////////////////////////
//:: Name ******
//:: FileName lm_damage_danger
//:: Copyright 2003 -=WRG!=-.
//:://////////////////////////////////////////////
/*
THIS SCRIPT CHECKS IF ANYBODY DAMAGED DANGER OBJECT MORE THEN 30%
THEN THE OBJECT EXPLOSE
EXPLOSION DEPENDS ON STRONG EXPLOSION RADIUS.
EXPLOSION RADIUS & STRONG ARE IN TrapKeyTag of object
*/

//:://////////////////////////////////////////////
//:: Created By: Lex
//:: Created On: October 2003
//:: Special thanks to:
//:: Baal (WRG) for advice about calculation power
//:://////////////////////////////////////////////

void DamageObject(float ExplosionRadius, int Strong, object oDamager, location lCenter)
{
float modifier=1.0;
effect eAddition;
int DamagePower=DAMAGE_POWER_PLUS_ONE;
float fDistance = GetDistanceBetweenLocations(GetLocation(oDamager),lCenter);
switch(Strong)
{
case 1: modifier=0.5;
DamagePower=DAMAGE_POWER_NORMAL;
eAddition = EffectFrightened();
break;
case 2: modifier=1.0;
DamagePower=DAMAGE_POWER_PLUS_ONE;
eAddition = EffectFrightened();
break;
case 3: modifier=1.5;
DamagePower=DAMAGE_POWER_PLUS_TWO;
eAddition = EffectParalyze();
break;
default:modifier=2.0;
DamagePower=DAMAGE_POWER_PLUS_THREE;
eAddition = EffectParalyze();
break;
}
int iDamage = FloatToInt((ExplosionRadius*ExplosionRadius/2 - fDistance*fDistance/2)*modifier+modifier*5);
effect eDamage = EffectDamage(iDamage,DAMAGE_TYPE_FIRE,DamagePower);
AssignCommand(oDamager,ClearAllActions());
AssignCommand(oDamager,DelayCommand(0.2,SetCommandable(FALSE,oDamager)));
if (GetObjectType(oDamager)==OBJECT_TYPE_CREATURE)
if (Random(2)==1)
AssignCommand(oDamager,PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,0.6,2.0));
else AssignCommand(oDamager,PlayAnimation(ANIMATION_LOOPING_DEAD_BACK,0.6,2.0));
AssignCommand(oDamager,DelayCommand(0.8,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_COM_HIT_FIRE),oDamager,1.0)));
if (fDistance<=ExplosionRadius/3)
{
float time = modifier*ExplosionRadius/fDistance;
AssignCommand(oDamager,DelayCommand(0.8,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAddition,oDamager,time)));
}
AssignCommand(oDamager,DelayCommand(0.3,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oDamager)));
AssignCommand(oDamager,DelayCommand(2.5,SetCommandable(TRUE,oDamager)));
}
void main()
{
//========================================================
int iDamage;
float ExplosionRadius;
int Strong;
location lCenter;
int Next=TRUE;
int Filter;
int Explosion;
object oDamager;
string STR;
int Critical=0;
Filter = OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE;
lCenter = GetLocation(OBJECT_SELF);
if (GetTrapKeyTag(OBJECT_SELF)!="**")
{
ExplosionRadius=5.0;
Strong=2;
}
else if (GetTag(OBJECT_SELF)!="ITM_FIREMINE")
{
iDamage = GetMaxHitPoints()-GetCurrentHitPoints();
STR = GetStringRight(GetTrapKeyTag(OBJECT_SELF),1);
if (STR!="") ExplosionRadius = StringToFloat(STR);
STR = GetStringLeft(GetTrapKeyTag(OBJECT_SELF),1);
if (STR!="") Strong = StringToInt(STR);
if ((Strong>3)||(Strong==0)) Strong=2;
if ((ExplosionRadius>10.0)||(ExplosionRadius==0.0)) ExplosionRadius=5.0;
if (iDamage*10 < GetMaxHitPoints()*3) return;
}
else
{
ExplosionRadius = 6.5;
Strong = 2;
SendMessageToPC(GetFirstPC(),"MINE");
}
Strong = GetLocalInt(OBJECT_SELF,"ADD_STRONG")+Strong;
if (Strong<3) Explosion = VFX_FNF_GAS_EXPLOSION_FIRE;
else Explosion = VFX_FNF_FIREBALL;
if ((iDamage<GetMaxHitPoints()/3)&&(GetDamageDealtByType(DAMAGE_TYPE_FIRE)==0)) return;
if (GetLocalInt(OBJECT_SELF,"ALREADY")) return;
SetLocalInt(OBJECT_SELF,"ALREADY",TRUE);
oDamager = GetFirstObjectInShape(SHAPE_SPHERE,ExplosionRadius,lCenter,TRUE,Filter);
object oPC = GetFirstPC();
DestroyObject(OBJECT_SELF);
if ((GetLocalInt(GetObjectByTag("TS_LOCALS"),"FIRECAMP_DESTROED"))&&(GetTag(GetArea(OBJECT_SELF))=="TSUR_SUB_EASTFOREST_BOMBCAVE"))
return;
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_PULSE_FIRE),lCenter,1.5);
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT,EffectVisualEffect(Explosion),lCenter);
while (GetIsObjectValid(oDamager))
{
if ((GetTag(oDamager)=="DANGER")&&(!GetLocalInt(oDamager,"ALREADY"))&&(GetDistanceToObject(oDamager)<=ExplosionRadius/2))
{
if (Next) SetLocalInt(oDamager,"ADD_STRONG",1);
ExplosionRadius = ExplosionRadius + 2.0;
Critical++;
}
if (Critical==3)
{
Next=TRUE;
}
if (Critical==5)
{
Strong++;
Critical=0;
}
AssignCommand(oDamager,DamageObject(ExplosionRadius,Strong,oDamager,lCenter));
oDamager = GetNextObjectInShape(SHAPE_SPHERE,ExplosionRadius,lCenter,TRUE,Filter);
}
}

: Aiwan Mar 17 2005, 16:18

" "
" AIWAN'"


smile.gif ...

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Created By: WRG! Aiwan aiwan@e-mail.ru
//:: Created On: 14.01.2004
//:://////////////////////////////////////////////
//:: " "
//:: ""
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"

void main()
{
if (GetArea(OBJECT_SELF) != GetArea(GetFirstPC()))
return; //
int nEvent = GetUserDefinedEventNumber();
if (nEvent == 1002) //
{
object oPC = GetLastPerceived();
object oNPC = OBJECT_SELF;
object oArm = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); // ""
if (GetLastPerceptionSeen() && GetIsPC(oPC))
{
if (GetTag(oArm) != "AM_ITM_IRONTRON" && GetLocalInt(oPC,"TRONE_ALARM") != 1)
// AM_ITM_IRONTRON
{
SetLocalInt(oPC, "TRONE_ALARM", 1); //
SetFacingPoint(GetPosition(oPC));
SpeakString(" , ?!");
AdjustReputation(oPC, oNPC, -100);
DetermineCombatRound(oPC);
}
if (GetLocalInt(oNPC, "LOOK") != 1 && GetTag(oArm) == "AM_ITM_IRONTRON" &&
GetLocalInt(oPC,"TRONE_ALARM") != 1)
{
SetLocalInt(oNPC, "LOOK", 1); //
AssignCommand(oNPC, ClearAllActions());
AssignCommand(oNPC, ActionDoCommand(SetFacingPoint(GetPosition(oPC))));
DelayCommand(16.0f, SetLocalInt(oNPC, "LOOK", 0));
int iRand = Random(10);
switch (iRand)
{
case 0:
{
SpeakString(" , !"); break;
}
case 1:
{
SpeakString(", ?"); break;
}
case 2:
{
SpeakString(", ..."); break;
}
case 3:
{
SpeakString(" ?"); break;
}
case 4:
{
SpeakString(" ?"); break;
case 5:
{
SpeakString(", ?"); break;
case 6:
{
SpeakString(" !"); break;
}
case 7:
{
SpeakString(" -..."); break;
}
case 8:
{
SpeakString(", ? ?"); break;
}
AssignCommand(oNPC, ActionDoCommand(WalkWayPoints()));
}
}
}
}
}
}
return;
}


, . 3.

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG! www.wrg.ru
//:: Name: oud_am_warrord
//:://////////////////////////////////////////////
/*
UserDefined -
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan Aiwan@e-mail.ru
//:: Created On: 26.02.2004
//:://////////////////////////////////////////////
void main()
{
int nEvent = GetUserDefinedEventNumber();
//======================= DAMAGED EVENT 1006 ===================================
if (nEvent == 1006)
{
object oPC = GetFirstPC(); // .
object oCat = GetHenchman(oPC);
object oWord = OBJECT_SELF;
object oSlave1 = GetObjectByTag("AM_SKELLETON_SLAVE_01"); // - 1
object oSlave2 = GetObjectByTag("AM_SKELLETON_SLAVE_02"); // - 2
object oWPTrone = GetObjectByTag("WP_TRONE_WARRIOR");
int iCurHP = GetCurrentHitPoints(OBJECT_SELF);
int iMaxHP = GetMaxHitPoints(OBJECT_SELF);
int iD;
//==============================================================================
if (!GetIsPC(oPC) || !GetLocalInt(oPC, "DALLIK_HELP"))
{return;}
int Class = GetClassByPosition(1, oPC); //
switch (Class)
{
case CLASS_TYPE_BARBARIAN:{iD = 200; break;}
case CLASS_TYPE_BARD:{iD = 300; break;}
case CLASS_TYPE_CLERIC:{iD = 250; break;}
case CLASS_TYPE_DRUID:{iD = 300; break;}
case CLASS_TYPE_FIGHTER:{iD = 200; break;}
case CLASS_TYPE_MONK:{iD = 150; break;}
case CLASS_TYPE_PALADIN:{iD = 200; break;}
case CLASS_TYPE_RANGER:{iD = 250; break;}
case CLASS_TYPE_ROGUE:{iD = 300; break;}
case CLASS_TYPE_SORCERER:{iD = 300; break;}
case CLASS_TYPE_WIZARD:{iD = 300; break;}
}

if (GetIsPC(oPC) && ((iMaxHP - iD) >= iCurHP) && !GetLocalInt(oWord, "DALLIK_JAMP"))
{
SetLocalInt(oWord, "DALLIK_JAMP", TRUE);
AssignCommand(oPC, ClearAllActions());
AssignCommand(oCat, ClearAllActions());
AssignCommand(OBJECT_SELF, ClearAllActions());
AssignCommand(oSlave1, ClearAllActions());
AssignCommand(oSlave2, ClearAllActions());
ExecuteScript("am_chang_fr_warr", OBJECT_SELF); //
// DelayCommand(0.5, ExecuteScript("am_scen_warr_03", oPC));
}
}
}


:
Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG! www.wrg.ru
//:: name: am_chang_fr_warr
//:://////////////////////////////////////////////
/*

*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan Aiwan@e-mail.ru
//:: Created On: 23.03.2004
//:://////////////////////////////////////////////
void main()
{
object oPC = GetFirstPC();
object oHen = GetHenchman(oPC);
object oWord = GetObjectByTag("AM_WARRIOR_HORDE"); //
object oSlave1 = GetObjectByTag("AM_SKELLETON_SLAVE_01"); // - 1
object oSlave2 = GetObjectByTag("AM_SKELLETON_SLAVE_02"); // - 2
location lClose = GetLocation(GetObjectByTag("AIWAN_CLOSE_ARENA")); //. Aiwan'a
object oNeutral = GetObjectByTag("AM_TRUE_NEUTRAL"); //
ChangeFaction(oWord, oNeutral);
ChangeFaction(oSlave1, oNeutral);
ChangeFaction(oSlave2, oNeutral);
//--------------------------------------
ClearPersonalReputation(oSlave1, oPC);
ClearPersonalReputation(oPC, oSlave1);
ClearPersonalReputation(oSlave1, oHen);
ClearPersonalReputation(oHen, oSlave1);
//--------------------------------------
ClearPersonalReputation(oSlave2, oPC);
ClearPersonalReputation(oPC, oSlave2);
ClearPersonalReputation(oSlave2, oHen);
ClearPersonalReputation(oHen, oSlave2);
//--------------------------------------
ClearPersonalReputation(oWord, oPC);
ClearPersonalReputation(oPC, oWord);
ClearPersonalReputation(oWord, oHen);
ClearPersonalReputation(oHen, oWord);
}





Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG
//:: a0_onareaexit
//:://////////////////////////////////////////////
/*
   
       
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan    Aiwan@e-mail.ru
//:: Created On: 21.04.2004
//:://////////////////////////////////////////////
void main()
{
  object oPC = GetEnteringObject();
  object oAnimal = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
  object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
  object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
  object oHenchman = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oPC);
  object oSummoned = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
  object oJamp = GetTransitionTarget(OBJECT_SELF);
  // , ,
  if (GetIsPC(oPC) && !GetIsPosessedFamiliar(oPC))
  {
  AssignCommand(oPC, JumpToObject(oJamp));
  AssignCommand(oAnimal, JumpToObject(oJamp));
  AssignCommand(oDominated, JumpToObject(oJamp));
  AssignCommand(oFamiliar, JumpToObject(oJamp));
  AssignCommand(oHenchman, JumpToObject(oJamp));
  AssignCommand(oSummoned, JumpToObject(oJamp));
  }
  else
  {
  // ya ,
  AssignCommand(oPC, ClearAllActions());
  }
}

: Lex Mar 18 2005, 22:42

" "
" MILEZ'"

:::::::::::::::::Milez::::::::::::::::::::::::::::::
May 22 2003
C .
OnPlayerDying .
+ , .
- as is, , - !

Neverwinter Script Source
void DyingTicker(object oPC)
{
int iHP=GetCurrentHitPoints(oPC);
if (iHP>0) {
RemoveEffect(oPC,EffectBlindness());
DeleteLocalInt(oPC,"DyingDC");
DeleteLocalInt(oPC,"STvsDeathSucceed");
return;
}
int iDC;
int iDam;
int iSuc;
if (iHP<-9) { ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(TRUE,TRUE),oPC); }
else {
iDam=d4();
iDC=GetLocalInt(oPC,"DyingDC");
if (FortitudeSave(oPC,iDC)>0) {
iDam=iDam/2;
iSuc=GetLocalInt(oPC,"STvsDeathSucceed")+1;
SetLocalInt(oPC,"STvsDeathSucceed",iSuc);
if (iSuc>2) {
FloatingTextStringOnCreature(" ",oPC,FALSE);
return;
}
}
AssignCommand(oPC,DelayCommand(6.0,DyingTicker(oPC)));
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(iDam), oPC);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBlindness(),oPC,6.0);
SetLocalInt(oPC,"DyingDC",iDC+1);
}
}

void main()
{
object oPC=GetLastPlayerDying();
if (!GetIsPC(oPC)) return;
SetLocalInt(oPC,"DyingDC",15);
SetLocalInt(oPC,"STvsDeathSucceed",0);
FloatingTextStringOnCreature(" z ",oPC,FALSE);
DyingTicker(oPC);
}

, (6 ) 1d4, DC, , 1 ( 15). 2 .
0 -9 - . -10 - .

************************************************************************************

:::::::::::::::::Milez::::::::::::::::::::::::::::::
May 24 2003

, D&D 3ed HEAT COLD DMG. , . . DMG (, DMG, , ).
, , ! / !

OnEnter .
Neverwinter Script Source
void DealTemperatureDamage(object oPC)

{
//
if (GetCurrentHitPoints(oPC)<1) return;
// ?
object oArea=GetArea(oPC);
// ?
int iT=GetLocalInt(oArea,"Temperature");
//
// ( 0 . 0 -1)
if (((iT<=32) && (iT>=4)) || (iT==0)) return;
//
int iDamType;
int iDamAmount;
int iSaveType;
float iInterval;

object oFire;
int iFatigue=FALSE;
int iFortSave;
int i;
effect eDam;
// / ?
int iCloth=(GetItemACValue(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC))>5)
||GetIsObjectValid((GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC)));
// "" ?
int iTimes=GetLocalInt(oPC,"TemperatureDamageTimer");
int iDC=15+iTimes; // DC
if (iT>32) { // !
FloatingTextStringOnCreature(" !",oPC);
iDamType=DAMAGE_TYPE_FIRE;
iSaveType=SAVING_THROW_TYPE_FIRE;
iDamAmount=d4();
if (iCloth) iDC+=4; // -4 +4 DC ( ). , smile.gif
if (iT>60) { // !
// 1d6 2
eDam=EffectDamage(d6(),iDamType);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oPC);
for (i=2;i<10;i+=2)
AssignCommand(oPC,DelayCommand(IntToFloat(i),
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oPC)));
iFatigue=TRUE;
iInterval=10.0;
} else if (iT>43) { // !
iInterval=20.0;
iFatigue=TRUE;
} else { //
iInterval=120.0;
}
} else if (iT<4) { // !
//
oFire=GetNearestObjectByTag("ku_campfire",oPC);
// ,
if ((GetIsObjectValid(oFire)) &&
(GetDistanceBetween(oFire,oPC)<5.0)) {
iDC=0;
RemoveEffect(oPC,EffectSlow());
iInterval=120.0;
} else {
iDamType=DAMAGE_TYPE_COLD;
iSaveType=SAVING_THROW_TYPE_COLD;
iDamAmount=d6();
FloatingTextStringOnCreature(" !",oPC);
if (iT<-18) { //
if (iCloth) iInterval=120.0; else iInterval=20.0;
iFatigue=TRUE;
} else { // Very cold
if (iCloth) iDC=0; //
iInterval=120.0;
}
}
}
if (iDC>0){
iFortSave=FortitudeSave(oPC,iDC,iSaveType);
if (iFortSave==0) {
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(iDamAmount,iDamType),oPC);
if (iFatigue) ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectSlow(),oPC,iInterval);
}
}
SetLocalInt(oPC,"TemperatureDamageTimer",iTimes+1);
AssignCommand(oPC,DelayCommand(iInterval,DealTemperatureDamage(oPC)));
}


void main()
{
object oPC=GetEnteringObject();
if (GetIsObjectValid(oPC)) {
DeleteLocalInt(oPC,"TemperatureDamageTimer");
AssignCommand(oPC,DealTemperatureDamage(oPC));
}
}


ku_campfire - ""

************************************************************************************

:::::::::::::::::Milez::::::::::::::::::::::::::::::
May 24 2003

"" . . , - . , , . / !
"" ( , , ) " ". Action Taken :
Neverwinter Script Source
void main()
{
object oPC=GetPCSpeaker();
object oPackAnimal=OBJECT_SELF;
location lLoc=GetLocation(oPC);
object oContainer=CreateObject(OBJECT_TYPE_PLACEABLE,"inviscont",lLoc);
object oEnum=GetFirstItemInInventory(oPackAnimal);
SetLocalObject(oContainer,"LinkedPackAnimal",oPackAnimal);
while (GetIsObjectValid(oEnum)) {
CopyObject(oEnum,lLoc,oContainer);
DestroyObject(oEnum);
oEnum=GetNextItemInInventory(oPackAnimal);
}
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionInteractObject(oContainer));
}

"" ( Invisible Object), "" Usable, Plot, Has Inventory. "inviscont". "" OnClose :
Neverwinter Script Source
void main()
{
object oMaster=GetLocalObject(OBJECT_SELF,"LinkedPackAnimal");
location lLoc=GetLocation(OBJECT_SELF);
object oEnum=GetFirstItemInInventory();
while (GetIsObjectValid(oEnum)) {
CopyObject(oEnum,lLoc,oMaster);
DestroyObject(oEnum);
oEnum=GetNextItemInInventory();
}
DelayCommand(1.0,DestroyObject(OBJECT_SELF));
}


************************************************************************************

:::::::::::::::::Milez::::::::::::::::::::::::::::::
May 27 2003
.
() ONYX'.
() Milez'.
, , , .
, , - Cast: Unique Power Unlim Times/Day. contract.
"", - Cast: Unique Power Self Only Unlim Times/Day. headofclient.
OnActivateItem :
Neverwinter Script Source
location RandomLocationFrom(location lOrigin)
{
vector vOrigin=GetPositionFromLocation(lOrigin);
vOrigin.x+=(Random(11)-5);
vOrigin.y+=(Random(11)-5);
return Location(GetAreaFromLocation(lOrigin),vOrigin,GetFacingFromLocation(lOrigin));
}

void SummonKiller(object oClient,object oMaster)
{
location lClient=RandomLocationFrom(GetLocation(oClient));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SMOKE_PUFF),lClient);
object oKiller=CreateObject(OBJECT_TYPE_CREATURE,"gypsy007",lClient);
SetLocalObject(oKiller,"MyClient",oClient);
SetLocalString(oKiller,"MyClientName",GetName(oClient));
SetLocalString(oKiller,"MyClientTag",GetTag(oClient));
SetLocalObject(oKiller,"MyMaster",oMaster);
& nbsp;DelayCommand(IntToFloat(Random(51)+50),AssignCommand(oKiller,ActionAttack(o
Client)));
}

void SummonKillers(object oClient,object oMaster,int iNumKillers)
{
int i;
for (i=1;i<=iNumKillers;i++) {
SummonKiller(oClient,oMaster);
}
}

void main()
{
object oOwner=GetItemActivator();
if (!GetIsPC(oOwner)) return;
object oSource=GetItemActivated();
object oTarget=GetItemActivatedTarget();
string sSourTag=GetTag(oSource);
if (sSourTag=="contract") {
int iNumOfKillers=GetLocalInt(oSource,"NumberOfKillers");
if (iNumOfKillers<1) {
DestroyObject(oSource);
} else
if ((GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) && (!GetIsDM(oTarget)) && (!GetPlotFlag(oTarget)))
{
FloatingTextStringOnCreature("The murder have been assigned!",oOwner,FALSE);
DelayCommand(IntToFloat(Random(51)+50),
SummonKillers(oTarget,oOwner,iNumOfKillers));
DestroyObject(oSource);
} else {
FloatingTextStringOnCreature("The murder can't be assigned to an item, DM or plot character!",oOwner,FALSE);
}
} else if (sSourTag=="headofclient") {
FloatingTextStringOnCreature("This is the head of "+
GetLocalString(oSource,"Client"),oOwner,FALSE);

}
}

:
( ). - , ,
(CreateItemOnObject("contract",oPC)).
- - (SetLocalInt(oContract,"NumberOfKillers",xxx))
. . "gypsy007". OnHeartbeat :
Neverwinter Script Source
void main()
{
object oClient=GetLocalObject(OBJECT_SELF,"MyClient");
object oMaster=GetLocalObject(OBJECT_SELF,"MyMaster");
object oMessenger;
string sNotifyVar;
if ((!GetIsObjectValid(oClient)) || GetIsDead(oClient)) {
if (GetIsObjectValid(oMaster)) {
sNotifyVar="Notified"+GetLocalString(OBJECT_SELF,"MyClientTag");
if (GetLocalInt(oMaster,sNotifyVar)!=TRUE) {
oMessenger=CreateObject(OBJECT_TYPE_CREATURE,"halfmerc002",
GetLocation(oMaster),TRUE);
SetLocalObject(oMessenger,"MyMaster",oMaster);
SetLocalString(oMessenger,"MyClient",GetLocalString(OBJECT_SELF,"MyClientName"));
SetLocalString(oMessenger,"NotifyVar",sNotifyVar);
SetLocalInt(oMaster,sNotifyVar,TRUE);
}
}
DestroyObject(OBJECT_SELF);
}
}

. . "halfmerc002".
, . :
Neverwinter Script Source
void main()
{
object oPC=GetPCSpeaker();
object oHead=CreateItemOnObject("headofclient",oPC);
SetLocalString(oHead,"Client",GetLocalString(OBJECT_SELF,"MyClient"));
SetLocalObject(oHead,"Master",oPC);
DeleteLocalInt(oPC,GetLocalString(OBJECT_SELF,"NotifyVar"));
}

: - /.
- ,
, .
/ "", 50-100
(DelayCommand(IntToFloat(Random(51)+50),... ) "" - . ( . Killer, , , ) , ( , ) . "". , - .
.

************************************************************************************

:::::::::::::::::Milez::::::::::::::::::::::::::::::
May 14 2003
( -).
Axistown'

kel_rest
Neverwinter Script Source
void DestroyFirecamp(object oCampFire=OBJECT_SELF)
{
//
object oLandMark=CreateObject(OBJECT_TYPE_PLACEABLE,"plc_weathmark",GetLocation(oCampFire));
// 120 (2 , 1 ).
AssignCommand(oLandMark,DelayCommand(120.0,DestroyObject(oLandMark)));
DestroyObject(oCampFire);
}

void ApplyRestEffect(object oTarget=OBJECT_SELF)
{
// . .
effect eSleep=EffectBlindness();

if (GetRacialType(oTarget)==RACIAL_TYPE_ELF)
{
// , (. D&D 3ed)
if (GetGender(oTarget)==GENDER_FEMALE)
FloatingTextStringOnCreature(" ",oTarget,FALSE);
else
FloatingTextStringOnCreature(" ",oTarget,FALSE);
} else

eSleep=EffectLinkEffects(eSleep,EffectVisualEffect(VFX_IMP_SLEEP));
// 30 . .
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eSleep,oTarget,30.0);
}

object FindFood(object oTarget=OBJECT_SELF)
{
object oEnum=GetFirstItemInInventory(oTarget);
while (GetIsObjectValid(oEnum) && (GetTag(oEnum)!="KEL_FOOD"))
oEnum=GetNextItemInInventory(oTarget);
return oEnum;
}


ku_makecamp ( OnUsed )
Neverwinter Script Source
#include "kel_rest"

void main()
{
object oPC=GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oTorch=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
if (GetIsObjectValid(oTorch) &&
(GetTag(oTorch) == "NW_IT_TORCH001") &&
// , ( )
(GetLocalInt(GetArea(oPC),"NoCampArea") != TRUE)) {
object oFire=CreateObject(OBJECT_TYPE_PLACEABLE,"ku_campfire",GetLocation(OBJECT_SELF));
DestroyObject(OBJECT_SELF);
// 900 (15 7,5 )
//
AssignCommand(oFire,DelayCommand(900.0,DestroyFirecamp(oFire)));
} else {
CreateItemOnObject("kel_wood",oPC);
DestroyObject(OBJECT_SELF);
}
}


kua_dropwood ( OnUnAquiredItem )
Neverwinter Script Source
void main()
{
object oPC=GetModuleItemLostBy();
if (!GetIsPC(oPC)) return;
object oItem=GetModuleItemLost();
if (!GetIsObjectValid(oItem)) return;
string sResRef=GetTag(oItem);
if (sResRef=="KEL_WOOD")
{
// by Milez on 14/05/2003, Guest
if (GetIsObjectValid(GetAreaFromLocation(GetLocation(oItem)))) {
CreateObject(OBJECT_TYPE_PLACEABLE,"ku_woodpile",GetLocation(oItem));
DestroyObject(oItem);
}
}
}


kr_resteffect ( OnRested )
Neverwinter Script Source
#include "kel_rest"
void main()
{
object oPC=GetLastPCRested();
if (GetCurrentAction(oPC)!=ACTION_REST) return;
int iFreeRest=GetLocalInt(GetArea(oPC),"FreeRestArea");
if (iFreeRest) ApplyRestEffect(oPC);
else {
object oCampFire=GetNearestObjectByTag("ku_campfire",oPC);
// 3 ( )
if (GetIsObjectValid(oCampFire) && (GetDistanceBetween(oPC,oCampFire)<=3.0)) {
object oFood=FindFood(oPC);
if (GetIsObjectValid(oFood)) {
DestroyObject(oFood);
ApplyRestEffect(oPC);
} else {
FloatingTextStringOnCreature(" ",oPC,FALSE);
AssignCommand(oPC,ClearAllActions());
}
} else {
FloatingTextStringOnCreature(" ",oPC,FALSE);
AssignCommand(oPC,ClearAllActions());
}
}
}


khb_cfire_sfx ( OnHeartbeat , , )
Neverwinter Script Source
void main()
{
PlaySound("al_cv_firecamp1");
}



"":
KEL_WOOD -
ku_woodpile -
ku_campfire -
KEL_FOOD -

************************************************************************************


:::::::::::::::::Milez::::::::::::::::::::::::::::::
May 29 2003
" ". . . - ApplyWindEffect.
:
int iWindForce - : 0 - Light wind; 1 - Moderate wind; 2 - Strong wind; 3 - Severe wind; 4 - Windstorm; 5 - Hurricane force wind; 6 - Tornado.
Neverwinter Script Source
float fWindDirection
- , .
Neverwinter Script Source
object oTarget
- ""
Heartbeat', , . :
Neverwinter Script Source
void main()
{
object oPC=GetFirstPC();
while (GetIsObjectValid(oPC)) {
ApplyWindEffect(4,45.0,oPC);
oPC=GetNextPC();
}
}

DMG.
.
Neverwinter Script Source
vector BlowAwayTo(vector vOrigin,float fAngle,float fRange)
{
float dx=fRange*cos(fAngle);
float dy=fRange*sin(fAngle);
return Vector(vOrigin.x+dx,vOrigin.y+dy,vOrigin.z);
}

// "". + 1d4*10 1d4 10 .
void ApplyBlowAwayEffect(float fWindDirection,object oTarget=OBJECT_SELF)
{
int iRange=d4();
int iDam=d4(iRange);
iRange *= 10;
float fRange=FeetToMeters(IntToFloat(iRange));
vector vNewPos=BlowAwayTo(GetPosition(oTarget),fWindDirection,fRange);
AssignCommand(oTarget,ClearAllActions(TRUE));
AssignCommand(oTarget,JumpToLocation(Location(GetArea(oTarget),vNewPos,GetFacin
g(oTarget))));
AssignCommand(oTarget,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectKnockdown(),oTarget,6.0));
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(iDam),oTarget);
PrintVector(vNewPos,TRUE);
}

void ApplyWindEffect(int iWindForce,float fWindDirection,object oTarget=OBJECT_SELF)
{
if (iWindForce<1) return;
object oTorch=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTarget);

if (GetBaseItemType(oTorch)==BASE_ITEM_TORCH) {
if (iWindForce==1) { // Moderate wind 50% ()
if (d2()==1) ActionUnequipItem(oTorch);
return;
} else { ActionUnequipItem(oTorch); } // Stronger winds extinguish fire at 100%
} else if (iWindForce==1) return; // If there's no lit torch moderate wind doesn't do any effect

int iCreatureSize=GetCreatureSize(oTarget);
// , , /
int iWpnType=GetBaseItemType(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget));
int iFeet;
vector vVec;
int bRangeWpn=FALSE;

if (iWpnType!=BASE_ITEM_INVALID) {
bRangeWpn=(iWpnType==BASE_ITEM_DART)||
(iWpnType==BASE_ITEM_HEAVYCROSSBOW)||
(iWpnType==BASE_ITEM_LIGHTCROSSBOW)||
(iWpnType==BASE_ITEM_LONGBOW)||
(iWpnType==BASE_ITEM_SHORTBOW)||
(iWpnType==BASE_ITEM_SHURIKEN)||
(iWpnType==BASE_ITEM_SLING)||
(iWpnType==BASE_ITEM_THROWINGAXE);
}

switch (iWindForce) {
case 2: // Strong wind
if (bRangeWpn)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectAttackDecrease(2),oTarget,6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_LISTEN,2),oTarget,6.0);

if (iCreatureSize==1) // . (Tiny)
if (FortitudeSave(oTarget,10)==0)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectKnockdown(),oTarget,3.0);
break;
case 3: // Severe wind
if (bRangeWpn)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectAttackDecrease(4),oTarget,6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_LISTEN,4),oTarget,6.0);

if (iCreatureSize<4)
if (FortitudeSave(oTarget,15)==0)
switch (iCreatureSize) {
case 3: // (Medium).
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectEntangle(),oTarget,6.0);
break;
case 2: // - (Small)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectKnockdown(),oTarget,6.0);
break;
case 1:
ApplyBlowAwayEffect(fWindDirection,oTarget);
}
break;
case 4: // Windstorm
if (bRangeWpn)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectAttackDecrease(50),oTarget,6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_LISTEN,8),oTarget,6.0);

if (iCreatureSize<6)
if (FortitudeSave(oTarget,18)==0)
switch (iCreatureSize) {
case 3:
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectKnockdown(),oTarget,6.0);
break;
case 4: // (Large)
case 5: // - (Huge)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectEntangle(),oTarget,6.0);
break;
case 2:
case 1:
ApplyBlowAwayEffect(fWindDirection,oTarget);
break;
}
break;
case 5: // Hurricane force wind
if (bRangeWpn)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectAttackDecrease(50),oTarget,6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_LISTEN,50),oTarget,6.0);

if (iCreatureSize<6)
if (FortitudeSave(oTarget,20)==0)
switch (iCreatureSize) {
case 3:
case 2:
case 1:
ApplyBlowAwayEffect(fWindDirection,oTarget);
break;
case 4:
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectKnockdown(),oTarget,6.0);
break;
case 5:
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectEntangle(),oTarget,6.0);
break;
}
break;
case 6: // Tornado (WOW!)
if (bRangeWpn)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectAttackDecrease(50),oTarget,6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_LISTEN,50),oTarget,6.0);
if ((iCreatureSize==5) && (FortitudeSave(oTarget,30)==0))
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectKnockdown(),oTarget,6.0);
else { // . , 1d10 , 6d6
iFeet=GetLocalInt(oTarget,"IsInTornado");
if (iFeet<1)
if (FortitudeSave(oTarget,30)==0) iFeet=d10();
if (iFeet>0) {
iFeet-=1;
// 30 .
// ,
// ,
// 10 .
vVec=GetPosition(oTarget);
vVec.x+=Random(21)-10;
vVec.y+=Random(21)-10;
AssignCommand(oTarget,ClearAllActions(TRUE));
AssignCommand(oTarget,JumpToLocation(Location(GetArea(oTarget),vVec,GetFacing(o
Target))));
AssignCommand(oTarget,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectKnockdown(),oTarget,6.0));
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(d6(6)),oTarget);
}
SetLocalInt(oTarget,"IsInTornado",iFeet);
}
break;
}
}

3 (Severe wind) Gust of Wind, SoU
spells.2da, , , .

************************************************************************************


:::::::::::::::::Milez::::::::::::::::::::::::::::::
Jun 8 2003
, . : , . , (. , , , ). , , .
DMG AD&D 3ed.
Neverwinter Script Source
int PRECIPITATION_RAIN=1;
int PRECIPITATION_SNOW=2;
int PRECIPITATION_SLEET=3;
int PRECIPITATION_HAIL=4;

void ApplyPrecipitationEffect(int iPrecType,object oTarget=OBJECT_SELF)
{
object oTorch=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTarget);
if (GetBaseItemType(oTorch)==BASE_ITEM_TORCH) ActionUnequipItem(oTorch);
int iWpnType=GetBaseItemType(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget));
int bRangeWpn=FALSE;

if (iWpnType!=BASE_ITEM_INVALID) {
bRangeWpn=(iWpnType==BASE_ITEM_DART)||
(iWpnType==BASE_ITEM_HEAVYCROSSBOW)||
(iWpnType==BASE_ITEM_LIGHTCROSSBOW)||
(iWpnType==BASE_ITEM_LONGBOW)||
(iWpnType==BASE_ITEM_SHORTBOW)||
(iWpnType==BASE_ITEM_SHURIKEN)||
(iWpnType==BASE_ITEM_SLING)||
(iWpnType==BASE_ITEM_THROWINGAXE);
}

switch(iPrecType) {
case 3: //PRECIPITATION_SLEET -
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectMovementSpeedDecrease(50),oTarget,7.0);
case 1: //PRECIPITATION_RAIN -
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_SPOT,4),oTarget,7.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_SEARCH,4),oTarget,7.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_LISTEN,4),oTarget,7.0);

if (bRangeWpn)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectAttackDecrease(4),oTarget,7.0);
break;
case 2: //PRECIPITATION_SNOW -
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectMovementSpeedDecrease(50),oTarget,7.0);

if (bRangeWpn)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectAttackDecrease(4),oTarget,7.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_SPOT,4),oTarget,7.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_SEARCH,4),oTarget,7.0);
break;
case 4: //PRECIPITATION_HAIL -
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectMovementSpeedDecrease(50),oTarget,7.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
EffectSkillDecrease(SKILL_LISTEN,4),oTarget,7.0);

if (d100()<=5) {
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(1,DAMAGE_TYPE_BLUDGEONIN
G),oTarget);
SendMessageToPC(oTarget,"z z .");
}
break;
}
}

, . , : .

************************************************************************************

: Lex Mar 18 2005, 23:50

" "
" MILEZ'"

:::::::::::::::::Milez::::::::::::::::::::::::::::::
Jun 29 2003
. , , , . .
Heartbeat , :

Neverwinter Script Source
void main()
{
object oSelf=OBJECT_SELF;
object oPC=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC);
if (!GetIsObjectValid(oPC)) return;
float fActDist=IntToFloat(GetMaxHitPoints()); // , - ,
if (GetDistanceBetween(oPC,oSelf)>fActDist) return;
int iSpawnDist=GetReflexSavingThrow(oSelf); // . -, - -
int iSpawnChance=GetWillSavingThrow(oSelf); // , %
int iMaxSpawn=GetFortitudeSavingThrow(oSelf); // . - -,
int iSpawned=GetLocalInt(oSelf,"SpawnedCreatures");
object oMonster;
string sMonster;
float fSpawnAngle;
float fSpawnDist;
vector vSpawnPlace;
location lSpawnLoc;
if (iSpawned<iMaxSpawn) {
if (d100()<=iSpawnChance) {
iSpawned++;
fSpawnDist=IntToFloat(Random(iSpawnDist)+1);
fSpawnAngle=IntToFloat(Random(360));
vSpawnPlace=GetPosition(oSelf);
vSpawnPlace.x+=fSpawnDist*cos(fSpawnAngle);
vSpawnPlace.y+=fSpawnDist*sin(fSpawnAngle);
lSpawnLoc=Location(GetArea(oSelf),vSpawnPlace,IntToFloat(Random(360)));
// -,
switch (Random(2)) {
case 0:
sMonster="nw_skeleton";
break;
case 1:
sMonster="nw_zombie01";
break;
}
oMonster=CreateObject(OBJECT_TYPE_CREATURE,sMonster,lSpawnLoc);
SetLocalObject(oMonster,"MySpawner",oSelf);
SetLocalObject(oSelf,"LastMonsterSpawned",oMonster);
}
}
SetLocalInt(oSelf,"SpawnedCreatures",iSpawned);
}


OnUserDefined nw_c2_defaultd 1007 (), -:
Neverwinter Script Source
...
object oSpawnPoint;
switch(iEvent) {
...
case 1007:
oSpawnPoint=GetLocalObject(OBJECT_SELF,"MySpawner");
if (GetIsObjectValid(oSpawnPoint)) {
SetLocalInt(oSpawnPoint,"SpawnedCreatures",GetLocalInt(oSpawnPoint,"SpawnedCreatures")-1);
}
break;
...
}


. . , 1 , . ,
:
- - ( ) :
Max Hit Points - , , .
Reflex Save - . - , -.
Fortitude Save - . - , - .
Will Save - , , (100 - , 0 - . 100 : , !)

************************************************************************************

:::::::::::::::::Milez::::::::::::::::::::::::::::::
Feb 24 2004
, . . , ... ! - !
:
Neverwinter Script Source
void SetGhostState(object oPC)
{
// polymorph, so we can't equip/use things, cast spells etc.
effect eGhost = EffectPolymorph(POLYMORPH_TYPE_SPECTRE,TRUE);
// this way we can pass thru other mobs
eGhost = EffectLinkEffects(EffectCutsceneGhost(),eGhost);
// ghosts are invisible, you know
eGhost = EffectLinkEffects(EffectInvisibility(INVISIBILITY_TYPE_DARKNESS),eGhost);
// ghosts can't attack as well
eGhost = EffectLinkEffects(EffectDazed(),eGhost);
// others can't detect ghosts, no way!
eGhost = EffectLinkEffects(EffectEthereal(),eGhost);
// these effects can't be dispelled, as well as they can't be removed by rest
eGhost = SupernaturalEffect(eGhost);

ApplyEffectToObject(DURATION_TYPE_PERMANENT,eGhost,oPC);
SetPlotFlag(oPC,TRUE); // ghosts are invincible
SetLocalInt(oPC,"IAmAGhost",1);
}

OnDeath, , , , - . , , "" , .

" MILEZ'" " "

: Lex Mar 19 2005, 01:06

" "
" _kaa_"

:::::::::::::::::_kaa_::::::::::::::::::::::::::::::
Feb 24 2004
. , -. - ( - )
.

Neverwinter Script Source
void main()
{
object oPC = GetEnteringObject();
string sCDKEY = GetPCPublicCDKey(oPC);
string sName = GetName(oPC);
string sPCName = GetPCPlayerName(oPC);
// ( ) - .
string sID = "("+sPCName+")"+sName;
int SecurityDisabled = GetLocalInt(GetModule(),"SecurityDisable");
//if (GetIsDM(oPC)) return;
WriteTimestampedLogEntry("Security: "+sName+" :["+sPCName+"]: with key ="+sCDKEY);
string sReadID = GetCampaignString("Security",sID);
// -
if (sReadID =="" || SecurityDisabled)
SetCampaignString("Security",sID,sCDKEY);
if (sReadID != sCDKEY && sReadID !="" && !SecurityDisabled)
{
BootPC(oPC);
SendMessageToAllDMs("Security: Error! "+sName+" :["+sPCName+"]: with key ="+sCDKEY+ " != "+sReadID);
WriteTimestampedLogEntry("Security: Error! "+sName+" :["+sPCName+"]: with key ="+sCDKEY+ " != "+sReadID);
}
else
WriteTimestampedLogEntry("Security: Check ok.");
}

- - :
dm_setmodulevarint SecurityDisable 1
:
dm_setmodulevarint SecurityDisable 0

************************************************************************************

:::::::::::::::::_kaa_::::::::::::::::::::::::::::::
Oct 3 2003
. , - . , , .. - 10 , .
. "_SHOP" (// , ). - wacko.gif
GetObjectType();
OnUnAcquireItem
:
ExecuteScript("at_check_dupe",OBJECT_SELF);

:
at_check_dupe
Neverwinter Script Source
void main()
{
object oLostItem = GetModuleItemLost();
object oLostBy = GetModuleItemLostBy();
object oNewPosessor = GetItemPossessor(oLostItem);

if (FindSubString(GetStringUpperCase(GetTag(oNewPosessor)),"_SHOP"))
{
int n = 0;
object oItem = GetFirstItemInInventory(oNewPosessor);
while (GetIsObjectValid(oItem))
{
if (GetTag(oLostItem) == GetTag(oItem)) n++;
if (n>1)
{
DestroyObject(oLostItem);
break;
}
oItem = GetNextItemInInventory(oNewPosessor);
}
}
}


************************************************************************************

:::::::::::::::::_kaa_::::::::::::::::::::::::::::::
Jan 30 2004
.
- . - .
( , ).
DayToNight() .
onPlayerEquipItem()
Neverwinter Script Source
void main()
{
object oPC = GetPCItemLastEquippedBy();
object oItem = GetPCItemLastEquipped();
if (GetTag(oItem) == "mg_it_ringghost")
{
effect E = EffectCutsceneGhost();
E = EffectLinkEffects(EffectEthereal(),E);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,E,oPC);
}
}
[/nss

onPlayerUnEquipItem()
[nss]
void FindAndRemoveGhostEffect(object O)
{
effect e = GetFirstEffect(O);
while (GetIsEffectValid(e))
{
if (GetEffectType(e) == EFFECT_TYPE_CUTSCENEGHOST)
RemoveEffect(O,e);
if (GetEffectType(e) == EFFECT_TYPE_ETHEREAL)
RemoveEffect(O,e);
e = GetNextEffect(O);
}
void main()
{
object oPC = GetPCItemLastUnequippedBy();
object oItem = GetPCItemLastUnequipped();
//
if (GetTag(oItem) == "mg_it_ringghost")
{
FindAndRemoveGhostEffect(oPC);
}

mg_it_ringghost - .
.

************************************************************************************

:::::::::::::::::_kaa_::::::::::::::::::::::::::::::
Mar 25 2004
, SendMessageToPC()
: <cRGB> </c>
RGB - , ascii - .
, " " () (32) "" (254) .
- s_end()
4 , :
Neverwinter Script Source
string s_green()
{
return "<c >";
}
string s_blue()
{
return "<c >";
}
string s_red()
{
return "<c >";
}
string s_white()
{
return "<c>";
}
string s_end()
{
return "</c>";
}


SetCustomToken

************************************************************************************

:::::::::::::::::_kaa_::::::::::::::::::::::::::::::
Mar 26 204
( .2da ).
- , 0..999

Neverwinter Script Source
//Add string S to array O[X,Y]
void _arr_SetStringXY(object O, int X,int Y,string S,string Prefix="_arr");
//Get string S from array O[X,Y]
string _arr_GetStringXY(object O, int X,int Y,string Prefix="_arr");
string _arr_AddNull(int I)
{
string result = "";
if (I<10) result+="0";
if (I<100) result+="0";
result += IntToString(I);
return result;
}

void _arr_SetStringXY(object O, int X,int Y,string S,string Prefix="_arr")
{
SetLocalString(O,Prefix+_arr_AddNull(X)+_arr_AddNull(Y),S);
}

string _arr_GetStringXY(object O, int X,int Y,string Prefix="_arr")
{
return GetLocalString(O,Prefix+_arr_AddNull(X)+_arr_AddNull(Y));
}


ps. , :
- ) ) ( , )

************************************************************************************

" _kaa_" " "

: Lex Mar 19 2005, 13:56

" "
" DBCOLL'A"

::::::::::::DBColl::::::::::::::::::::
May 7 2003
, .
"OnUsed"

Neverwinter Script Source
void main()
{
object oDoor=GetNearestObjectByTag("_");
if(GetIsOpen(oDoor)) //
{
AssignCommand(OBJECT_SELF,ActionCloseDoor(oDoor));
// . .
SetLocked(oDoor,TRUE); //
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
//
}
else if(!GetIsOpen(oDoor)) //,
{
SetLocked(oDoor,FALSE);//
AssignCommand(OBJECT_SELF,ActionOpenDoor(oDoor));
// .
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
//
}
}


************************************************************************************

:::::::::::::::::DBColl::::::::::::::::::::::::::::::
May 8 2003
18 , , 15 .
( )
Neverwinter Script Source
void main()
{
object oPC = GetFirstPC();
object oFlame = GetObjectByTag(" ");
int nSpeedOfDec = 3;
// 3 ( 18 1 )
int nSpeed = GetLocalInt(oPC, "DecHealthSpeed");
// , == 0
if (nSpeed == nSpeedOfDec && GetDistanceBetween(oPC, oFlame) > 15.0)
// Health
// (15 )
{
effect eDamage = EffectDamage( 1, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL);
/// -
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);
///
AssignCommand(oPC, ActionSpeakString(", ..."));
SetLocalInt(oPC, "DecHealthSpeed", 0);
return;
}
else if (GetDistanceBetween(oPC, oFlame) < 15.0
&& GetCurrentHitPoints(oPC) <= GetMaxHitPoints(oPC))
/// 15 , 2
{
effect eHeal = EffectHeal(2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC);
return;
}
SetLocalInt(oPC, "DecHealthSpeed", nSpeed+1);
}


************************************************************************************

:::::::::::::::::DBColl::::::::::::::::::::::::::::::
May 28 2003
. ( ) . UserDefined
Neverwinter Script Source
#include nw_i0_generic
void main()
{
int nEvent = GetUserDefinedEventNumber();
if (nEvent == 1002)
{
object oNPC = GetLastPerceived();
if (GetFactionEqual(oNPC, OBJECT_SELF))
{
if (GetLastPerceptionSeen() && GetDistanceToObject(oNPC) < 6.0f &&
GetLocalInt(oNPC, "GREATED") != 1)
{
SetLocalInt(oNPC, "GREATED", 1);
AssignCommand(oNPC, ClearAllActions());
AssignCommand(oNPC, ActionDoCommand(SetFacingPoint(GetPosition(OBJECT_SELF))));
AssignCommand(oNPC, ActionSpeakString(" !"));
AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_FIREFORGET_SALUTE, 0.5f, 1.0f));
AssignCommand(oNPC, ActionDoCommand(WalkWayPoints()));
DelayCommand(15.0f, SetLocalInt(oNPC, "GREATED", 0));
}
}
return;
}
}


************************************************************************************

:::::::::::::::::DBColl::::::::::::::::::::::::::::::
Feb 20 2004
-, , - , ... :
1. . ! .
Neverwinter Script Source
//::///////////////////////////////////////////////
//:: Name
//:: Copyright 2003 WRG!
//:://////////////////////////////////////////////
//:: Created By: DBColl
//:: Created On: 7.09.2003
//:://////////////////////////////////////////////
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC) || GetLocalInt(OBJECT_SELF, "triggered") > 0)
return;
string sStr = GetName(OBJECT_SELF);
AssignCommand(oPC, SpeakString(sStr));
if (GetLockKeyTag(OBJECT_SELF) == "")
SetLocalInt(OBJECT_SELF, "triggered", 1);
}

2. , Name , !!!
3. KeyTag - ( !) PC, .

************************************************************************************

" DBCOLL'A" " "


: Lex Mar 19 2005, 15:03

" "
" LAZY RAMN'"

::::::::::::Lazy Ramna::::::::::::::::::::
Oct 14 2003
LEX: LAZY. 2003 !! DUMBO
, ""
"" , . ax_letter_ya "". ya() , "" "". pardon.gif

Neverwinter Script Source
string ya(string sMessage = "")
{
string sYa = GetName(GetObjectByTag("ax_letter_ya"));
string sResult = "";
string sSub;
int i = 0;
while ((sSub = GetSubString(sMessage, i, 2)) != "")
{
if (sSub == "")
{
sResult += sYa;
i += 2;
}
else
{
sResult += GetStringLeft(sSub, 1);
i++;
}
}
return sResult;
}


:
1) string sMessage = ""+ya()+" "+ya()+" ";
2) string sMessage = ya(" ");
sMessage " "

************************************************************************************

::::::::::::Lazy Ramna::::::::::::::::::::
Mar 15 2004
, ( ), "". , KeyTag. OnEnter.
Neverwinter Script Source
void main()
{
object oPC = GetEnteringObject();
object oTarget = GetObjectByTag(GetTrapKeyTag(OBJECT_SELF));
if (GetIsObjectValid(oPC) && GetIsObjectValid(oTarget)) {
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, JumpToObject(oTarget));
}
}

, . PC "" , , .
18:57
. - /////, . ( UNIX_TIMESTAMP ) AX_LIB_START_YEAR - .
Neverwinter Script Source
// 2003 by Alexander Ponyatikh, aka Lazy Ranma

const int AX_LIB_START_YEAR = 0;

int GetCurrentYear()
{
return GetCalendarYear() - AX_LIB_START_YEAR;
}

int GetCurrentMonth()
{
return GetCurrentYear()*12 + GetCalendarMonth();
}

int GetCurrentDay()
{
return (GetCurrentMonth() - 1)*28 + GetCalendarDay();
}

int GetCurrentHour()
{
return (GetCurrentDay() - 1)*24 + GetTimeHour();
}

int GetCurrentMinute()
{
return GetCurrentHour()*FloatToInt(HoursToSeconds(1))/60 + GetTimeMinute();
}

int GetCurrentSecond()
{
return GetCurrentMinute()*60 + GetTimeSecond();
}


************************************************************************************

" LAZY RAMN'" " "

: Lex Mar 19 2005, 16:06

" "
" BAAL'A"

::::::::::::Baal::::::::::::::::::::
May 7 2003
( ) .

Neverwinter Script Source
void main()
{
  object oPC = GetFirstPC();
  /// ( GetObjectByTag(" ")
  object oInv = GetFirstItemInInventory(oPC);
    ///
  while(GetIsObjectValid(oInv)) ///
      {
      DestroyObject(oInv); ///
      oInv = GetNextItemInInventory(oPC);
      ///
      }
    int i=0;
    while(i<14
      {
      DestroyObject(GetItemInSlot(i, oPC)); ///
      i++;
      }
}


************************************************************************************

::::::::::::Baal::::::::::::::::::::
Aug 18 2003
, , . , .
Neverwinter Script Source
void main()
{
int iHour=GetTimeHour();
int iGameHourRealMinutes = 2; // 1 ( )
float fMinute = IntToFloat(GetTimeMinute());
float fSecond = IntToFloat(GetTimeSecond());
float fGameMinute = fMinute*(60/iGameHourRealMinutes)+(fSecond/iGameHourRealMinutes);
int iMinute=FloatToInt(fGameMinute);
string sHour;
string sMinute;
if(iHour>0||iHour==21)
sHour=" ";
if(iHour>1||iHour>21)
sHour=" ";
if(iHour>4&&iHour<21)
sHour=" ";
if(iHour==0)
sHour=" ";
sHour=IntToString(iHour)+sHour;

int iVR=StringToInt(GetStringRight(IntToString(iMinute),1));
if(iVR==0)
sMinute=IntToString(iMinute)+" .";
if(iVR>0)
sMinute=IntToString(iMinute)+" .";
if(iVR>1)
sMinute=IntToString(iMinute)+" .";
if(iVR>4||(iMinute>10&&iMinute<21))
sMinute=IntToString(iMinute)+" .";
if(iMinute<10)
sMinute="0"+sMinute;

AssignCommand(GetFirstPC(),SpeakString(" : "+sHour+sMinute));
PlaySound("as_an_rooster1");// :-)
}


************************************************************************************

::::::::::::Baal::::::::::::::::::::
. oInventory - . sItemTag -
Neverwinter Script Source
int ItemsAmount(string sItemTag, object oCreature = OBJECT_SELF)
{
int N=0;
object oItem = GetFirstItemInInventory(oCreature);
while (GetIsObjectValid(oItem))
  {
  if(GetTag(oItem) == sItemTag)
      {
      N = N + GetNumStackedItems(oItem);
      }
  oItem = GetNextItemInInventory(oCreature);
  }
return N;
}


************************************************************************************

" BAAL'A" " "

: Lex Mar 19 2005, 16:21

" "
" SMITH'A"

::::::::::::Smith::::::::::::::::::::
Sep 24 2003
- . ( ), , . :

Neverwinter Script Source
location RandomLocation(object oTarget, float fRadius, int iLine = TRUE)
{
if(!iLine)
fRadius=IntToFloat(Random(FloatToInt(fRadius)));

float iXO=VectorMagnitude(GetPosition(oTarget))*cos(VectorToAngle(GetPosition(oTarget)
));
float iYO=VectorMagnitude(GetPosition(oTarget))*sin(VectorToAngle(GetPosition(oTarget)
));
float fRndomAngle=IntToFloat(Random(360));
location lNewLoc=Location(GetArea(oTarget),Vector(iXO+fRadius*cos(fRndomAngle),iYO+fRadiu
s*sin(fRndomAngle)),360.0);
return lNewLoc;
}

fRadius oTarget, , iLine = FALSE, , , , fRadius.

************************************************************************************

" SMITH'A" " "

: Lex Mar 19 2005, 16:22

" "
" SELLARY"

::::::::::::sellary::::::::::::::::::::
Oct 20 2003
, .
:
oArmor - ,
oCreature - ,
TRUE, , FALSE - .
(, " ").
Lazy Ranma spurlos - , DBColl .

Neverwinter Script Source
int GetIsValidArmor(object oArmor, object oCreature)
{
  //
  int nPrice = GetGoldPieceValue(oArmor);

  //
  int nClass = GetHitDice(oCreature);

  // , nClass
  // nPrice
  // ( #13 ;
  // , , 20
  // )
  int bResult = TRUE;
  switch (nClass) {
  case 1: bResult = (nPrice<=1000);
  break;
  case 2: bResult = (nPrice<=1500);
  break;
  case 3: bResult = (nPrice<=2500);
  break;
  case 4: bResult = (nPrice<=3500);
  break;
  case 5: bResult = (nPrice<=5000);
  break;
  case 6: bResult = (nPrice<=6500);
  break;
  case 7: bResult = (nPrice<=9000);
  break;
  case 8: bResult = (nPrice<=12000);
  break;
  case 9: bResult = (nPrice<=15000);
  break;
  case 10: bResult = (nPrice<=19500);
  break;
  case 11: bResult = (nPrice<=25000);
  break;
  case 12: bResult = (nPrice<=30000);
  break;
  case 13: bResult = (nPrice<=35000);
  break;
  case 14: bResult = (nPrice<=40000);
  break;
  case 15: bResult = (nPrice<=50000);
  break;
  case 16: bResult = (nPrice<=65000);
  break;
  case 17: bResult = (nPrice<=75000);
  break;
  case 18: bResult = (nPrice<=90000);
  break;
  case 19: bResult = (nPrice<=110000);
  break;
  case 20: bResult = (nPrice<=130000);
  break;
  default: bResult = (nClass>20);
  break;
  };

  //
  return bResult;
}


************************************************************************************

" SELLARY" " "

: Lex Mar 19 2005, 16:23

" "
" GREEDO BEEFY"

::::::::::::Greedo Beefy::::::::::::::::::::
Jan 10 2004
...
, PW, .
, , OnHeartBeat

Neverwinter Script Source
void SaveCurTime (int minutes)
{
  int current = GetLocalInt(GetModule(), "cyclestill");
  if (current < ((minutes * 60) / 6))
  SetLocalInt(GetModule(), "cyclestill", current + 1);
  else
  {
        object oMod = GetModule();
        int iMonth = GetCalendarMonth();
        int iDay = GetCalendarDay();
        int iYear = GetCalendarYear();
        int iHour = GetTimeHour();
        SetCampaignInt("server_time", "CUR_YEAR", iYear, oMod);
        SetCampaignInt("server_time", "CUR_DAY", iDay, oMod);
        SetCampaignInt("server_time", "CUR_MONTH", iMonth, oMod);
        SetCampaignInt("server_time", "CUR_HOUR", iHour, oMod);
        SetLocalInt(GetModule(), "cyclestill", 0);
        WriteTimestampedLogEntry("Save Current Time completed");
  }
return;
}
void main ()
{
SaveCurTime(10);
}

( ) , .
OnModuleLoad :
Neverwinter Script Source
void main()
{
object oMod = GetModule();
int iMonthNew = GetCampaignInt("server_time", "CUR_MONTH", oMod);
int iDayNew = GetCampaignInt("server_time", "CUR_DAY", oMod);
int iYearNew = GetCampaignInt("server_time", "CUR_YEAR", oMod);
int iHourNew = GetCampaignInt("server_time", "CUR_HOUR", oMod);
SetCalendar (iYearNew, iMonthNew, iDayNew);
SetTime (iHourNew, 0, 0, 0);
}

, .


************************************************************************************

" GREEDO BEEFY" " "

: Lex Mar 19 2005, 16:24

" "
" DOCFEERT'A"

::::::::::::DocFeert::::::::::::::::::::
Feb 10 2004
:
C OnHeartBeat
, .

Neverwinter Script Source
void main()
{
object oItem = GetFirstObjectInArea(GetArea(OBJECT_SELF));
while (GetIsObjectValid(oItem) == TRUE)
ClearAllActions();
{
if (GetObjectType(oItem) == OBJECT_TYPE_ITEM)
{
ActionPickUpItem(oItem);
}
oItem = GetNextObjectInArea(GetArea(OBJECT_SELF));
}
}


************************************************************************************

::::::::::::DocFeert::::::::::::::::::::
Feb 24 2004
- . oObject - , - oObject.
Neverwinter Script Source
int Percent(object oObject)
{
int iCur = GetCurrentHitPoints(oObject);
int iMax = GetMaxHitPoints(oObject);
int iSt = iCur * 100;
int iPercent = iSt / iMax;
return iPercent;
}


************************************************************************************

::::::::::::DocFeert::::::::::::::::::::
Feb 24 2004
. 2 . OnEnter :
Neverwinter Script Source
void main()
{
object oDoor = GetFirstObjectInShape(SHAPE_SPHERE, 3.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_DOOR);
if (GetLocked(OBJECT_SELF) == FALSE)
{
ActionOpenDoor(oDoor);
}
}

OnExit :
Neverwinter Script Source
void main()
{
if (GetLocked(OBJECT_SELF) == FALSE)
{
object oDoor = GetFirstObjectInShape(SHAPE_SPHERE, 3.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_DOOR);
ActionCloseDoor(oDoor);
}
}

.

************************************************************************************

::::::::::::DocFeert::::::::::::::::::::
Mar 10 2004
" ", , , ... - . oArea , , , Y Y, sObjByResRef , iObjType (OBJECT_TYPE_*) iMaxObjects .
Neverwinter Script Source
void RandomObjectsAtRandomLocation(object oArea, int X, int Y, string sObjByResRef, int iObjType, int iMaxObjects)
{
int iMax = 0;
float fX = IntToFloat(Random(X * 10));
float fY = IntToFloat(Random(Y * 10));
float fZ = 0.0;
float fF = IntToFloat(Random(360));
location lLoc = Location(oArea, Vector(fX, fY, fZ), fF);
while (iMax != iMaxObjects)
{
iMax = iMax + 1;
float fX = IntToFloat(Random(X * 10));
float fY = IntToFloat(Random(Y * 10));
float fZ = 0.0;
float fF = IntToFloat(Random(360));
location lLoc = Location(oArea, Vector(fX, fY, fZ), fF);
if (d2(1) == 2)
{
CreateObject(iObjType, sObjByResRef, lLoc, FALSE);
}
}
}


************************************************************************************

::::::::::::DocFeert::::::::::::::::::::
Mar 10 2004
(, , ) . oAreaFrom , oAreaTo , iDestroy = TRUE, oAreaFrom . , .
Neverwinter Script Source
void MoveArea(object oAreaFrom, object oAreaTo, int iDestroy=TRUE)
{
object oObject = GetFirstObjectInArea(oAreaFrom);
while (GetIsObjectValid(oObject) == TRUE)
{
location lLoc = Location(oAreaTo, GetPosition(oObject), GetFacing(oObject));
if (GetObjectType(oObject) == OBJECT_TYPE_ITEM)
{
CopyObject(oObject, lLoc, OBJECT_INVALID, GetTag(oObject));
if (iDestroy == TRUE)
{
DestroyObject(oObject);
}
}
if ((GetObjectType(oObject) == OBJECT_TYPE_PLACEABLE))
{
string sTag = GetResRef(oObject);
CreateObject(OBJECT_TYPE_PLACEABLE, sTag, lLoc);
if (iDestroy == TRUE)
{
DestroyObject(oObject);
}
}
if (GetObjectType(oObject) == OBJECT_TYPE_CREATURE)
{
AssignCommand(oObject, JumpToLocation(lLoc));
}
oObject = GetNextObjectInArea(oAreaFrom);
}
}


************************************************************************************

" DOCFEERT'A" " "

: Lex Mar 19 2005, 16:26

" "
" MALKOR'A"

::::::::::::MalkoR::::::::::::::::::::
Sep 13 2003
. , 4 . 10 , . onHeartbeat 10 . .
onHeartbeat

Neverwinter Script Source
void main()
{
object wp_k4 = GetObjectByTag("TWp_KEEPER4"); //WayPoint , , .
AssignCommand(OBJECT_SELF, ActionJumpToObject(wp_k4)); //
object os = OBJECT_SELF;
effect eff = EffectBeam(VFX_BEAM_LIGHTNING,os,BODY_NODE_CHEST,FALSE); // ( , , , - )

object c1 = GetObjectByTag("TP_CORPOSE_001"); //
object c2 = GetObjectByTag("TP_CORPOSE_002");
object c3 = GetObjectByTag("TP_CORPOSE_003");
object c4 = GetObjectByTag("TP_CORPOSE_004");
object c5 = GetObjectByTag("TP_CORPOSE_005");
object c6 = GetObjectByTag("TP_CORPOSE_006");
object c7 = GetObjectByTag("TP_CORPOSE_007");
object c8 = GetObjectByTag("TP_CORPOSE_008");
object c9 = GetObjectByTag("TP_CORPOSE_009");
object c10 = GetObjectByTag("TP_CORPOSE_010");

int a = d10();

if (a == 1)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eff,c1,6.0f);
return;
}
if (a == 2)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eff,c2,6.0f);
return;
}
if (a == 3)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eff,c3,6.0f);
return;
}
///. . . . . . ( == 4, ==5 .. 9) . . . . . . .

if (a == 10)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eff,c10,6.0f);
return;
}
}


************************************************************************************

" MALKOR'A" " "

: Lex Mar 19 2005, 16:28

" "
" VALLEO"

::::::::::::Valleo::::::::::::::::::::
Mar 19 2004
:

Neverwinter Script Source
void StartBog()
{
object oBog = OBJECT_SELF;
object oArea = GetArea(oBog);
location lLocation = GetLocation(oBog);
location lLoc;
location lLocat;
object oObject = GetFirstObjectInShape(SHAPE_SPHERE,100.0,lLocation,FALSE,OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oObject))
{
lLoc = GetLocation(oObject);
lLocat = GetLocalLocation(oObject,"BOGLOC");
if(GetIsObjectValid(GetAreaFromLocation(lLocat)))
{
float fDist = GetDistanceBetweenLocations(lLoc,lLocat);
if(fDist < 5.0)
  {
  effect eSlow = EffectMovementSpeedDecrease(75);
  ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eSlow,oObject,70.0);
  FloatingTextStringOnCreature(" ...",oObject,FALSE);
  }
}
SetLocalLocation(oObject,"BOGLOC",lLoc);
oObject = GetNextObjectInShape(SHAPE_SPHERE,100.0,lLocation,FALSE,OBJECT_TYPE_CREATURE);
}
}
void main()
{
object oBog = OBJECT_SELF;
int iTimer = GetLocalInt(oBog,"TIMER");
if(iTimer <= 9)
{
iTimer = iTimer + 1;
SetLocalInt(oBog,"TIMER",iTimer);
return;
}
SetLocalInt(oBog,"TIMER",0);
StartBog();
}

( )...

************************************************************************************

::::::::::::Valleo::::::::::::::::::::
Mar 19 2004
Persuade. , ...
:
NPC: !
1) ! ?
NPC (1) [ ] , ! <-- Persuade
NPC (2) [ ] ?
2) , ...
Neverwinter Script Source
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oNPC = OBJECT_SELF;
object oWinner;
int iCharisma = GetAbilityScore(oPC,ABILITY_CHARISMA);
if(iCharisma < 7)
{
SendMessageToPC(oPC," 7, "+GetName(oNPC));
return FALSE;
}
int iPCPersuade, iNPCPersuade;
int iAddPC, iAddNPC;
int iPCCharModif, iNPCCharModif;
if(GetHasSkill(SKILL_PERSUADE,oPC)) iPCPersuade = GetSkillRank(SKILL_PERSUADE,oPC);
if(GetHasSkill(SKILL_PERSUADE,oNPC)) iNPCPersuade = GetSkillRank(SKILL_PERSUADE,oNPC);
iPCCharModif = GetAbilityModifier(ABILITY_CHARISMA,oPC);
iNPCCharModif = GetAbilityModifier(ABILITY_CHARISMA,oNPC);
iAddPC = d12();
iAddNPC = d12();
SendMessageToPC(oPC," Persuade:");
SendMessageToPC(oPC," = "+IntToString(iPCPersuade)+" + "+IntToString(iAddPC)+" (d12) + "+IntToString(iPCCharModif)+" ( ) = " +IntToString(iPCPersuade+iAddPC+iPCCharModif));
SendMessageToPC(oPC," = "+IntToString(iNPCPersuade)+" + "+IntToString(iAddNPC)+" (d12) + "+IntToString(iNPCCharModif)+" ( ) = " +IntToString(iNPCPersuade+iAddNPC+iNPCCharModif));
iPCPersuade = iPCPersuade + iAddPC + iPCCharModif;
iNPCPersuade = iNPCPersuade + iAddNPC + iNPCCharModif;
if(iPCPersuade > iNPCPersuade)
{
SendMessageToPC(oPC," .");
return TRUE;
}
SendMessageToPC(oPC," .");
return FALSE;
}


************************************************************************************

" VALLEO" " "

: Lex Mar 19 2005, 16:30

" "
" "

:::::::::::: ::::::::::::::::::::
May 17 2003
. . . .
. h01. onDeath . , .
. Nekrolog01.

Neverwinter Script Source
void Raise()
{
effect eVisDead = EffectVisualEffect(VFX_IMP_HEAD_ACID);/// . !
object oNew = CreateObject(OBJECT_TYPE_CREATURE,"ZombieWeak07", GetLocation(OBJECT_SELF)) ;/// .
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eVisDead, GetLocation(oNew));

}
void main()
{
object oCleric = GetNearestObjectByTag("Nekrolog01");/// . .

if (GetIsObjectValid(oCleric) == TRUE && GetIsDead(oCleric) == FALSE)
{
AssignCommand(oCleric, ClearAllActions());
AssignCommand(oCleric, ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP, 1.0, 3.0));/// "" . .
effect eVisCleric = EffectVisualEffect(VFX_IMP_AURA_NEGATIVE_ENERGY);/// . . !
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisCleric, oCleric);
DelayCommand(3.0, Raise());
DelayCommand(0.2,AssignCommand(oCleric, SpeakOneLinerConversation())) ;
}
}

.

************************************************************************************

:::::::::::: ::::::::::::::::::::
May 17 2003
. . 10 . 1 OnHeartbeat. OnPlayerDying. /// .
Neverwinter Script Source
void loadBehaviors()
{
SetLocalInt(OBJECT_SELF, "DEATH_TARGET", -10);
SetLocalInt(OBJECT_SELF, "PLAYER_ONLY_GRUNTS_WHILE_DYING", FALSE);
}
void bleedCheck(object pc)
{
if (!GetIsPC(pc))
return;
int DEATH_TARGET = GetLocalInt(OBJECT_SELF, "DEATH_TARGET");
int PLAYER_ONLY_GRUNTS_WHILE_DYING = GetLocalInt(OBJECT_SELF, "PLAYER_ONLY_GRUNTS_WHILE_DYING");
int hp = GetCurrentHitPoints(pc);
if ((hp <= 0) && (hp > DEATH_TARGET))
{
effect dmg = EffectDamage(1);
ApplyEffectToObject(DURATION_TYPE_INSTANT, dmg, pc);
int which = Random(6)+1;
if (PLAYER_ONLY_GRUNTS_WHILE_DYING)
switch (which)
{
case 1:
PlayVoiceChat(VOICE_CHAT_PAIN1, pc);
break;
case 2:
PlayVoiceChat(VOICE_CHAT_PAIN2, pc);
break;
case 3:
PlayVoiceChat(VOICE_CHAT_PAIN3, pc);
break;
case 4:
PlayVoiceChat(VOICE_CHAT_HEALME, pc);
break;
case 5:
PlayVoiceChat(VOICE_CHAT_NEARDEATH, pc);
break;
case 6:
PlayVoiceChat(VOICE_CHAT_HELP, pc);
break;
  }
}
else if (hp <= DEATH_TARGET)
  {
  effect death = EffectDeath(FALSE, FALSE);
  ApplyEffectToObject(DURATION_TYPE_INSTANT, death, pc);
  }
}

void main()
{
loadBehaviors();
object pc = GetFirstPC();
while (GetIsObjectValid(pc))
  {
  bleedCheck(pc);
  pc = GetNextPC();
  }
}



Neverwinter Script Source
void main()
{
// load up desired behaviors for all OnHeartbeat scripts
loadBehaviors();

// enumerate all PCs, calling bleedCheck on each
// if you want to add more / other scripts that act on all players
// every heartbeat, this is the place to do it ... just put a call
// to them after (or before) bleedCheck, within the while loop.
object pc = GetFirstPC();

while (GetIsObjectValid(pc))
{
bleedCheck(pc);
pc = GetNextPC();
}
}


************************************************************************************

:::::::::::: ::::::::::::::::::::
Jun 3 2003
. . OnUsed
. .
Neverwinter Script Source
void main()
{
object oPC = GetLastUsedBy();
object oTarget = GetObjectByTag("Waypoint"); /// Waypoint-, .
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_X); /// .
location lPC = GetLocation(oPC);
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eVis, lPC);
AssignCommand(oPC,JumpToObject(oTarget));
}


************************************************************************************

:::::::::::: ::::::::::::::::::::
Jun 3 2003
C . Heartbeat!!
( .)
Neverwinter Script Source
void main()
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
if ((GetIsObjectValid(oPC) != TRUE) || (GetIsDead(oPC) == TRUE) || GetDistanceToObject(oPC) >= 10.0)
{
location l = GetLocation(OBJECT_SELF);
location lNew = Location( GetAreaFromLocation(l), GetPositionFromLocation(l), GetFacingFromLocation(l) + 180);
// CreateObject( OBJECT_TYPE_PLACEABLE, "plc_statue3", lNew );
CreateObject(OBJECT_TYPE_PLACEABLE, "StatueStone", lNew); /// .
DestroyObject(OBJECT_SELF, 0.5);
}
}


************************************************************************************

" " " "

: Lex Mar 19 2005, 16:31

" "
" NEUROSHOOTA"

::::::::::::neuroshoot::::::::::::::::::::
Jun 19 2003
( , , ).
:

Neverwinter Script Source
void main()
{
object oArea = OBJECT_SELF;
int nRain = WEATHER_RAIN;
int nClear = WEATHER_CLEAR;
int nDef = WEATHER_USE_AREA_SETTINGS;
int nHour = GetTimeHour();
if(nHour == 20|| nHour == 21|| nHour == 22|| nHour == 23||
nHour == 24|| nHour == 0 || nHour == 1 || nHour == 2 ||
nHour == 3 || nHour == 4 || nHour == 5 || nHour == 6 &&
!GetLocalInt(oArea, "IsDef") == 1)
{
SetWeather(oArea, nDef);
SetLocalInt(oArea, "IsRaining", 0);
SetLocalInt(oArea, "IsClear", 0);
SetLocalInt(oArea, "IsDef", 1);
}

if(nHour == 7 || nHour == 8 || nHour == 9 || nHour == 10||
nHour == 11|| nHour == 12&&
!GetLocalInt(oArea, "IsClear") == 1)
{
SetWeather(oArea, nClear);
SetLocalInt(oArea, "IsRaining", 0);
SetLocalInt(oArea, "IsClear", 1);
SetLocalInt(oArea, "IsDef", 0);
}

if(nHour == 13|| nHour == 14|| nHour == 15|| nHour == 16||
nHour == 17|| nHour == 18|| nHour == 19&&
!GetLocalInt(oArea, "IsRaining") == 1)
{
SetWeather(oArea, nRain);
SetLocalInt(oArea, "IsRaining", 1);
SetLocalInt(oArea, "IsClear", 0);
SetLocalInt(oArea, "IsDef", 0);
}
}

. , , . , ( ..).

************************************************************************************

" " " "

: Lex Mar 19 2005, 16:33

" "
" AIWAN'A"

::::::::::::Aiwan::::::::::::::::::::
Jan 19 2004
.

Neverwinter Script Source
//::///////////////////////////////////////////////////////////
//:: Created By: WRG! Aiwan aiwanwrg.ru
//:: Created On: 19.01.2004
//:://////////////////////////////////////////////////////////
/*
OnOpen .
, ,

F-2, .
, .
*/

//:://////////////////////////////////////////////////////////
void main()
{
object oPC = GetLastOpenedBy();

if (!GetIsPC(oPC) || GetLocalInt(OBJECT_SELF, "DO_IT") ||
!GetLocalInt(oPC, "_"))
{return;}
SetLocalInt(OBJECT_SELF, "DO_IT", TRUE);

if(GetLevelByClass(CLASS_TYPE_CLERIC, oPC) >= 1) // 1 .
{
CreateItemOnObject("res-ref ", OBJECT_SELF, 1);
return;
}
if(GetLevelByClass(CLASS_TYPE_WIZARD,oPC) >= 1) // 1 .
{
CreateItemOnObject("res-ref ", OBJECT_SELF, 1);
return;
}
CreateItemOnObject("res-ref ", OBJECT_SELF, 1); //
return;
}


************************************************************************************

::::::::::::Aiwan::::::::::::::::::::
Mar 5 2004
, OnOpen , .. , . ,
Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Created By: WRG! Aiwan aiwane-mail.ru
//:: Created On: 06.12.2003
//:://////////////////////////////////////////////
/* OnOpen .
, .
, .
*/

//:://////////////////////////////////////////////
#include "nw_i0_tool"
void main()
{
object oPC = GetLastOpenedBy();

if (GetIsPC(oPC) && GetLocalInt(OBJECT_SELF, "DO_IT") != 1 &&
(AutoDC(DC_HARD, SKILL_SEARCH, oPC))) //
{
AssignCommand(oPC, SpeakString("B ."));
if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD) //
{
CreateItemOnObject("ResRef ", OBJECT_SELF, 1);
}
if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL) //
{
CreateItemOnObject("ResRef ", OBJECT_SELF, 1);
}
RewardPartyXP(1500, oPC);
SetLocalInt(OBJECT_SELF, "DO_IT", 1);
}
if (GetIsPC(oPC) && GetLocalInt(OBJECT_SELF, "DO_IT") != 1)
{
AssignCommand(oPC, SpeakString(" ."));
RewardPartyXP(500, oPC);
SetLocalInt(OBJECT_SELF, "DO_IT", 1);
}
}


************************************************************************************

::::::::::::Aiwan::::::::::::::::::::
Mar 5 2004
. , , . , , . , ,

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG!
//:://////////////////////////////////////////////
/*
OnHeartBeat
.
.

*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 03.02.2004
//:://////////////////////////////////////////////

void main()
{
object oItm = OBJECT_SELF;
object oTarget = GetObjectByTag("WP_NIMPHA_GOST"); //
object oGost = GetObjectByTag("ANDR_GOST");
//===================== ܠ ====================
if (GetIsDay() && GetLocalInt(OBJECT_SELF, "NIGHT") == 1)
{
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SOUND_BURST), GetLocation(oGost));
ActionWait(1.0);
ActionDoCommand(DestroyObject(oGost));
SetLocalInt(OBJECT_SELF, "NIGHT", 0);
}
if (!GetIsNight() && GetLocalInt(OBJECT_SELF, "NIGHT") == 0)
return;
//===================== =====================
{
if (!GetIsNight() || GetLocalInt(OBJECT_SELF, "NIGHT") == 1)
return;

oGost = CreateObject(OBJECT_TYPE_CREATURE, "ResRef_", GetLocation(oTarget));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_IMP_DEATH_WARD), GetLocation(oTarget));
AssignCommand(oGost, ClearAllActions());
SetLocalInt(OBJECT_SELF, "NIGHT", 1);
}
}


, . :
Neverwinter Script Source
if (GetTimeHour()==23) //


************************************************************************************

::::::::::::Aiwan::::::::::::::::::::
Mar 8 2004
, , : " . " . , - . , .
, . , .
, . , .
Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG!
//:: OnFailToOpen
//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 10.01.2004
//:://////////////////////////////////////////////
void main()
{
string oDoor = GetTag(OBJECT_SELF);
string sMesseg = "! TAG !"; //
{
if (oDoor == "TAG__01" || oDoor == "TAG__02") //
{sMesseg = " , .";}
if (oDoor == "TAG__03")
{sMesseg = " .";}
SpeakString(sMesseg);
}
}


Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG!
//:: OnFailToOpen
//:://////////////////////////////////////////////
/*
WP_DOOR_TXT - .
.
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 10.01.2004
//:://////////////////////////////////////////////
void main()
{
object oWp = GetNearestObjectByTag("WP_DOOR_TXT"); //
string sDoor = GetName(oWp);

if (GetIsObjectValid(oWp) && GetDistanceBetween(oWp, OBJECT_SELF) <= 10.0f)
// WP 10
{
SpeakString(sDoor); //
return;
}
else
{
SpeakString("! WP_DOOR_TXT!");//
return;
}
}


************************************************************************************

::::::::::::Aiwan::::::::::::::::::::
Mar 14 2004
. , .
+4, +5 .. -

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Copyright 2004 WRG! www.wrg.ru
//:: OnOpen OBJECT
//:://////////////////////////////////////////////
/*
 
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan Aiwane-mail.ru
//:: Created On: 14.03.2004
//:://////////////////////////////////////////////
void main()
{
object oPC = GetLastOpenedBy();
string sResRef;
if (!GetIsPC(oPC) || GetLocalInt(OBJECT_SELF, "DO_IT"))
{return;}
{
SetLocalInt(OBJECT_SELF, "DO_IT", TRUE);
int iPrize = Random(10);
  switch (iPrize)
  {
  case 0:
  {
sResRef = "sResRef_itm"; break;
  }
  case 1:
  {
sResRef = "sResRef_itm"; break;
  }
  case 2:
  {
sResRef = "sResRef_itm"; break;
  }
  case 3:
  {
sResRef = "sResRef_itm"; break;
  }
  case 4:
  {
sResRef = "sResRef_itm"; break;
  }
  case 5:
  {
sResRef = "sResRef_itm"; break;
  }
  case 6:
  {
sResRef = "sResRef_itm"; break;
  }
  case 7:
  {
sResRef = "sResRef_itm"; break;
  }
  case 8:
  {
sResRef = "sResRef_itm"; break;
  }
  case 9:
  {
sResRef = "sResRef_itm"; break;
  }
  }
  CreateItemOnObject(sResRef, OBJECT_SELF, 1); //
  CreateItemOnObject("sResRef_itm_2", OBJECT_SELF, 1); // , .. 2
  }
}


************************************************************************************

" AIWAN'A" " "

: Lex Mar 19 2005, 16:34

" "
" EXICUTIONER'A"

::::::::::::NightElf-Sniper aka Executioner::::::::::::::::::::
:

Neverwinter Script Source
//:: Dlg_Open_Store :: Executioner :://

void main()
{
string sNPSTag = GetTag(OBJECT_SELF);
object oStore = GetNearestObjectByTag(sNPSTag+"_store");

if(GetObjectType(oStore) == OBJECT_TYPE_STORE)
OpenStore(oStore, GetPCSpeaker());

else
ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK);
}

, :
m_weapons, m_weapons_store, ...
:
Neverwinter Script Source
/******************************
Name: _On_Pl_Death
Autor: Executioner
*******************************/


void main()
{
object oDied = GetLastPlayerDied();
object oHenchman = GetHenchman(oDied);
object oKiller = GetLastAttacker(oDied);
object oMod = GetModule();

string sName = GetName(oDied);
string sID = GetName(oDied)+GetPCPublicCDKey(oDied); //ID , ...

int iGold = GetGold(oDied);

location lDiedHere = GetLocation(oDied);

object oDeathCorpse=CreateObject(OBJECT_TYPE_PLACEABLE,"mod_deathcorpse",lDiedHere,FALSE,"DeathCorpse"+sID);
object oBag = CreateItemOnObject("mod_bagofgold",oDeathCorpse);


//
if (GetIsObjectValid(oHenchman))
RemoveHenchman(oDied, oHenchman);


//
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oDied);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oDied)), oDied);
AssignCommand(oDied, ActionJumpToObject(GetObjectByTag("wp_death"))); &#092;&#092; , (&#092;)


// 10%
int iDeadXP = 10;
int iXP = GetXP(oDied);
int iNewXP = iXP-iXP*iDeadXP/100;

SetXP(oDied, iNewXP);

//
SetLocalString(oDeathCorpse,"oDiedName",sName);
SetLocalInt(oBag,"Gold",iGold);

int i;
for(i=0;i<15;i++)
AssignCommand(oDeathCorpse, ActionTakeItem(GetItemInSlot(i, oDied), oDied));

AssignCommand(oDeathCorpse, TakeGoldFromCreature(iGold,oDied,TRUE));
}
[nss]

[nss]
//:: OnOpen_DthCorpse :: Executioner :://
void main()
{
SpeakString("Corpse of "+GetLocalString(OBJECT_SELF,"oDiedName"),TALKVOLUME_TALK);
}


Neverwinter Script Source
//:: OnClse_DthCorpse :: Executioner :://
void main()
{
if(GetIsObjectValid(GetFirstItemInInventory(OBJECT_SELF))==FALSE)
DelayCommand(3.0,DestroyObject(OBJECT_SELF));
}

1 1 (\)

:
tag: Mod_DeathCorpse
resref: mod_deathcorpse
Usable Has Inventory
OnClose OnClse_DthCorpse, OnOpen OnOpen_DthCorpse
:
tag: Mod_BagOfGold
resref: mod_bagofgold

: , 10% . , . , ) .
- , , ...

************************************************************************************

" EXICUTIONER'A" " "

: Lex Mar 19 2005, 16:37

" "
" (MOF)DARTH_NICK'A"

::::::::::::[MoF]Darth_Nick::::::::::::::::::::
Jul 3 2004

Neverwinter Script Source
/*
Created By: [MoF]Darth_Nick
Data Of Creating: 02.07.2004 11:03
Discription: So, this script is do following - when you have a level up, after up
script founding your alignment(GOOD, EVIL, NEUTRAL) and doing something visual effects
for you. Also effects maybe change if you change Constans...Sample:
VFX_FNF_SUMMON_EPIC_UNDEAD - this is first constant of evil leveling, delete that and
enter something yours in the list of constants, an example - VFX_FNF_IMPLOSION.
*/


void main()
{
object oPC = GetPCLevellingUp();

if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL)
{
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD), oPC));
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HARM), oPC));
}
else if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD)
{
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HOLY_AID), oPC));
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUNBEAM), oPC));
}
else if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL)
{
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SOUND_BURST), oPC));
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_X), oPC));
}
}


************************************************************************************

::::::::::::[MoF]Darth_Nick::::::::::::::::::::
Jul 3 2004

Neverwinter Script Source
/*
Created By: [MoF]Darth_Nick
Data Of Creating: 11:37
Discription: Script is stand on a OnEnter of Generic Triger, you also can use it in the
trap, but unexpectandlly is be very other!
*/


void main()
{
object oPC = GetEnteringObject();
effect eBall = EffectVisualEffect(VFX_FNF_FIREBALL);

if (GetIsPC(oPC) == GetCurrentHitPoints(oPC) < 70)
{
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBall, oPC));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oPC));
}
else if (GetIsPC(oPC) == GetCurrentHitPoints(oPC) > 70)
{
FloatingTextStringOnCreature("Heh...This trick is not for me!", oPC);
}
}


************************************************************************************

" (MOF)DARTH_NICK'A" " "

: Lex Mar 19 2005, 16:39

" "
" RED DEVIL'A"

::::::::::::Red Devil::::::::::::::::::::
Jul 31 2004
. .
+1 .

Neverwinter Script Source
#include "x2_inc_itemprop"
void main()
{
int iBonus;
object oPC=GetPCSpeaker();
object oArmor=GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
itemproperty ipHasAC=GetFirstItemProperty(oArmor);
GetItemPropertyType(ipHasAC)==ITEM_PROPERTY_AC_BONUS;
if (!GetIsObjectValid(oArmor)) return;
if (GetBaseItemType(oArmor)!=BASE_ITEM_ARMOR) return;
{
iBonus=GetItemPropertyCostTableValue(ipHasAC);
if (iBonus<0) iBonus=0;
iBonus++;
itemproperty ipAddAC=ItemPropertyACBonus(iBonus);
IPSafeAddItemProperty(oArmor,ipAddAC);
}
}


************************************************************************************

::::::::::::Red Devil::::::::::::::::::::
Jul 31 2004
+1 , +1 .
Neverwinter Script Source
#include "x2_inc_itemprop"
void main()
{
object oPC=GetPCSpeaker();
object oWeap=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
int iBonus;
int bType=GetBaseItemType(oWeap);
if (!GetIsObjectValid(oWeap)) return;
if ((bType == BASE_ITEM_BASTARDSWORD) ||
(bType == BASE_ITEM_BATTLEAXE) ||
(bType == BASE_ITEM_CLUB) ||
(bType == BASE_ITEM_DAGGER) ||
(bType == BASE_ITEM_DIREMACE) ||
(bType == BASE_ITEM_DOUBLEAXE) ||
(bType == BASE_ITEM_DWARVENWARAXE) ||
(bType == BASE_ITEM_GREATAXE) ||
(bType == BASE_ITEM_GREATSWORD) ||
(bType == BASE_ITEM_HALBERD) ||
(bType == BASE_ITEM_HANDAXE) ||
(bType == BASE_ITEM_HEAVYFLAIL) ||
(bType == BASE_ITEM_KAMA) ||
(bType == BASE_ITEM_KATANA) ||
(bType == BASE_ITEM_KUKRI) ||
(bType == BASE_ITEM_LIGHTFLAIL) ||
(bType == BASE_ITEM_LIGHTHAMMER) ||
(bType == BASE_ITEM_LIGHTMACE) ||
(bType == BASE_ITEM_LONGSWORD) ||
(bType == BASE_ITEM_MORNINGSTAR) ||
(bType == BASE_ITEM_QUARTERSTAFF) ||
(bType == BASE_ITEM_RAPIER) ||
(bType == BASE_ITEM_SCIMITAR) ||
(bType == BASE_ITEM_SCYTHE) ||
(bType == BASE_ITEM_SHORTSPEAR) ||
(bType == BASE_ITEM_SHORTSWORD) ||
(bType == BASE_ITEM_SICKLE) ||
(bType == BASE_ITEM_TWOBLADEDSWORD) ||
(bType == BASE_ITEM_WARHAMMER) ||
(bType == BASE_ITEM_WHIP) ||
(bType == BASE_ITEM_SHURIKEN) ||
(bType == BASE_ITEM_WHIP))
{
iBonus=IPGetWeaponEnhancementBonus(oWeap);
iBonus++;
itemproperty ipAdd=ItemPropertyEnhancementBonus(iBonus);
IPSafeAddItemProperty(oWeap,ipAdd);
}
else
if ((bType == BASE_ITEM_SLING)||
(bType == BASE_ITEM_SHORTBOW)||
(bType == BASE_ITEM_LONGBOW)||
(bType == BASE_ITEM_LIGHTCROSSBOW)||
(bType == BASE_ITEM_HEAVYCROSSBOW))
{
itemproperty ipHasAttack=GetFirstItemProperty(oWeap);
GetItemPropertyType(ipHasAttack)==ITEM_PROPERTY_ATTACK_BONUS;
iBonus=GetItemPropertyCostTableValue(ipHasAttack);
if (iBonus<0) iBonus=0;
iBonus++;
itemproperty ipAddAttack=ItemPropertyAttackBonus(iBonus);
IPSafeAddItemProperty(oWeap,ipAddAttack);
}
}


************************************************************************************

" RED DEVIL'A" " "


" "

: Lex Mar 24 2005, 11:10

" "
" BAAL'A"

" ", . ! bm_inv_transit1 . bm_inv_transit3 , ( ).

2 SECOND_PC SECOND_HENCH
3 transit_cont1, transit_cont2 transit_cont3

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: FileName bm_inv_transit1
//:: 2005 WRG!
//:://////////////////////////////////////////////
/*
 
,
. ""
 
*/

//:://////////////////////////////////////////////
//:: Created By: BaaL
//:: Created On:
//:://////////////////////////////////////////////

int GetHasObject (object oCreature, object oItem)
{
object oItm = GetFirstItemInInventory(oCreature);
while(GetIsObjectValid(oItm))
{
if (oItm == oItem) return TRUE;
oItm = GetNextItemInInventory(oCreature);
}
return FALSE;
}

void main()
{
object oPC = GetFirstPC();
object oHench = GetHenchman(oPC);
object oSecPC = GetObjectByTag("SECOND_PC");
object oSecHench = GetObjectByTag("SECOND_HENCH");
object oCopy;
object oItem;
string sContainerTag;
object oContainer;
// .
if(!GetIsObjectValid(oHench)) return;
// plot PC
sContainerTag = "transit_cont1";
oContainer = CreateItemOnObject(sContainerTag, oSecPC);
oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
if(GetPlotFlag(oItem))
{
if(GetBaseItemType(oItem) != BASE_ITEM_LARGEBOX)
{
oCopy = CopyItem(oItem, oContainer, TRUE);
if(!GetHasObject(oContainer, oCopy))
{
DestroyObject(oCopy);
oContainer = CreateItemOnObject(sContainerTag, oSecPC);
oCopy = CopyItem(oItem, oContainer, TRUE);
}
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oPC);
}

// plot Hench
sContainerTag = "transit_cont2";
oContainer = CreateItemOnObject(sContainerTag, oSecHench);
oItem = GetFirstItemInInventory(oHench);
while(GetIsObjectValid(oItem))
{
if(GetPlotFlag(oItem))
{
if(GetBaseItemType(oItem) != BASE_ITEM_LARGEBOX)
{
oCopy = CopyItem(oItem, oContainer, TRUE);
if(!GetHasObject(oContainer, oCopy))
{
DestroyObject(oCopy);
oContainer = CreateItemOnObject(sContainerTag, oSecHench);
oCopy = CopyItem(oItem, oContainer, TRUE);
}
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oHench);
}
// not plot PC
sContainerTag = "transit_cont1";
oContainer = CreateItemOnObject(sContainerTag, oSecPC);
oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
if(!GetPlotFlag(oItem))
{
if(GetBaseItemType(oItem) != BASE_ITEM_LARGEBOX)
{
oCopy = CopyItem(oItem, oContainer, TRUE);
if(!GetHasObject(oContainer, oCopy))
{
DestroyObject(oCopy);
oContainer = CreateItemOnObject(sContainerTag, oSecPC);
oCopy = CopyItem(oItem, oContainer, TRUE);
}
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oPC);
}
// not plot Hench
sContainerTag = "transit_cont2";
oContainer = CreateItemOnObject(sContainerTag, oSecHench);
oItem = GetFirstItemInInventory(oHench);
while(GetIsObjectValid(oItem))
{
if(!GetPlotFlag(oItem))
{
if(GetBaseItemType(oItem) != BASE_ITEM_LARGEBOX)
{
oCopy = CopyItem(oItem, oContainer, TRUE);
if(!GetHasObject(oContainer, oCopy))
{
DestroyObject(oCopy);
oContainer = CreateItemOnObject(sContainerTag, oSecHench);
oCopy = CopyItem(oItem, oContainer, TRUE);
}
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oHench);
}
// :
DelayCommand(0.5, ExecuteScript("bm_inv_transit2", OBJECT_SELF));
}

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: FileName bm_inv_transit2
//:: 2005 WRG!
//:://////////////////////////////////////////////
/*
  ,
.
  (NEW!)
*/

//:://////////////////////////////////////////////
//:: Created By: BaaL
//:: Created On:
//:://////////////////////////////////////////////

void FindContainers(object oCreature)
{
int NN=0;
object oItm = GetFirstItemInInventory(oCreature);
while(GetIsObjectValid(oItm))
{
if(GetBaseItemType(oItm) == BASE_ITEM_LARGEBOX)
{
SetIdentified(oItm, TRUE);
NN++;
SetLocalInt(oCreature, "CONT_NUMBER", NN);
SetLocalObject(oCreature, "CONTAINER"+IntToString(NN), oItm);
}
oItm = GetNextItemInInventory(oCreature);
}
return;
}

int Ncont(object oCreature)
{
return GetLocalInt(oCreature, "CONT_NUMBER");
}

object GiveContainer(object oCreature, int NN)
{
return GetLocalObject(oCreature, "CONTAINER"+IntToString(NN));
}

void DeleteLocals(object oCreature)
{
int NN = Ncont(oCreature);
int NN1 = 1;
while (NN >= NN1)
{
DeleteLocalObject(oCreature, "CONTAINER"+IntToString(NN1));
NN1++;
}
DeleteLocalInt(oCreature, "CONT_NUMBER");
return;
}

int GetHasObject (object oCreature, object oItem)
{
object oItm = GetFirstItemInInventory(oCreature);
while(GetIsObjectValid(oItm))
{
if (oItm == oItem) return TRUE;
oItm = GetNextItemInInventory(oCreature);
}
return FALSE;
}

void main()
{
object oPC = GetFirstPC();
object oHench = GetHenchman(oPC);
object oSecPC = GetObjectByTag("SECOND_PC");
object oSecHench = GetObjectByTag("SECOND_HENCH");
object oCopy;
string sContainerTag;
int iContNumber = 1;
object oContainer;
object oItem = GetFirstItemInInventory(oHench);
while(GetIsObjectValid(oItem))
{
if(GetBaseItemType(oItem) == BASE_ITEM_LARGEBOX)
{
oCopy = CopyItem(oItem, oPC);
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oHench);
}
FindContainers(oPC);
///---///---
sContainerTag = "transit_cont1";
// oContainer = CreateItemOnObject(sContainerTag, oPC);
oContainer=(iContNumber>Ncont(oPC))?CreateItemOnObject(sContainerTag,oPC):GiveContainer(oPC,iContNumber);
oItem = GetFirstItemInInventory(oSecPC);
while(GetIsObjectValid(oItem))
{
if(GetBaseItemType(oItem) != BASE_ITEM_LARGEBOX && GetTag(oItem) != sContainerTag)
{
oCopy = CopyItem(oItem, oContainer, TRUE);
// esli item v sumku ne vlez - sozdaem novuyu
if(!GetHasObject(oContainer, oCopy))
{
DestroyObject(oCopy);
// oContainer = CreateItemOnObject(sContainerTag, oPC);
iContNumber++;
oContainer=(iContNumber>Ncont(oPC))?CreateItemOnObject(sContainerTag,oPC):GiveContainer(oPC,iContNumber);
oCopy = CopyItem(oItem, oContainer, TRUE);
}
// uni4tojaem original
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oSecPC);
}

///---///---
sContainerTag = "transit_cont2";
// oContainer = CreateItemOnObject(sContainerTag, oPC);
iContNumber++;
oContainer=(iContNumber>Ncont(oPC))?CreateItemOnObject(sContainerTag,oPC):GiveContainer(oPC,iContNumber);
oItem = GetFirstItemInInventory(oSecHench);
while(GetIsObjectValid(oItem))
{
if(GetBaseItemType(oItem) != BASE_ITEM_LARGEBOX && GetTag(oItem) != sContainerTag)
{
oCopy = CopyItem(oItem, oContainer, TRUE);
// esli item v sumku ne vlez - sozdaem novuyu
if(!GetHasObject(oContainer, oCopy))
{
DestroyObject(oCopy);
// oContainer = CreateItemOnObject(sContainerTag, oPC);
iContNumber++;
oContainer=(iContNumber>Ncont(oPC))?CreateItemOnObject(sContainerTag,oPC):GiveContainer(oPC,iContNumber);
oCopy = CopyItem(oItem, oContainer, TRUE);
}
// uni4tojaem original
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oSecHench);
}

///---///---
sContainerTag = "transit_cont3";
oContainer = CreateItemOnObject(sContainerTag, oPC);
int iSlot = 0;
oItem = GetItemInSlot(iSlot, oHench);
while (iSlot < 14)
{
if(GetIsObjectValid(oItem))
{
oCopy = CopyItem(oItem, oContainer, TRUE);
// esli item v sumku ne vlez - sozdaem novuyu
if(!GetHasObject(oContainer, oCopy))
{
DestroyObject(oCopy);
oContainer = CreateItemOnObject(sContainerTag, oPC);
oCopy = CopyItem(oItem, oContainer, TRUE);
}
// uni4tojaem original
DestroyObject(oItem);
}
iSlot ++;
oItem = GetItemInSlot(iSlot, oHench);
}
DeleteLocals(oPC);

oItem = GetFirstItemInInventory(oSecPC);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oSecPC);
}
oItem = GetFirstItemInInventory(oSecHench);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oSecHench);
}
}

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: FileName bm_inv_transit3
//:: 2005 WRG!
//:://////////////////////////////////////////////
/*
 
.
 
  , .
*/

//:://////////////////////////////////////////////
//:: Created By: BaaL
//:: Created On:
//:://////////////////////////////////////////////
int GetSuitableSlot(object oItem)
{
int iSlot;
switch (GetBaseItemType(oItem))
{
case BASE_ITEM_AMULET:   iSlot = INVENTORY_SLOT_NECK; break;
case BASE_ITEM_ARMOR: iSlot = INVENTORY_SLOT_CHEST;   break;
case BASE_ITEM_ARROW: iSlot = INVENTORY_SLOT_ARROWS; break;
case BASE_ITEM_BASTARDSWORD:  iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_BATTLEAXE: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_BELT:   iSlot = INVENTORY_SLOT_BELT; break;
case BASE_ITEM_BOLT:   iSlot = INVENTORY_SLOT_BOLTS;   break;
case BASE_ITEM_BOOTS: iSlot = INVENTORY_SLOT_BOOTS;   break;
case BASE_ITEM_BRACER:   iSlot = INVENTORY_SLOT_ARMS; break;
case BASE_ITEM_BULLET:   iSlot = INVENTORY_SLOT_BULLETS;  break;
case BASE_ITEM_CLOAK: iSlot = INVENTORY_SLOT_CLOAK;   break;
case BASE_ITEM_CLUB:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_DAGGER:   iSlot = INVENTORY_SLOT_LEFTHAND; break;
case BASE_ITEM_DART:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_DIREMACE:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_DOUBLEAXE: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_DWARVENWARAXE: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_GLOVES:   iSlot = INVENTORY_SLOT_ARMS; break;
case BASE_ITEM_HALBERD: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_HANDAXE: iSlot = INVENTORY_SLOT_LEFTHAND; break;
case BASE_ITEM_HEAVYCROSSBOW: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_HEAVYFLAIL:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_HELMET:   iSlot = INVENTORY_SLOT_HEAD; break;
case BASE_ITEM_KAMA:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_KATANA:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_KUKRI: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_LARGESHIELD: iSlot = INVENTORY_SLOT_LEFTHAND; break;
case BASE_ITEM_LIGHTCROSSBOW: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_LIGHTFLAIL:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_LIGHTHAMMER: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_LIGHTMACE: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_LONGBOW: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_LONGSWORD: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_MAGICSTAFF:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_MORNINGSTAR: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_QUARTERSTAFF:  iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_RAPIER:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_RING:   iSlot = INVENTORY_SLOT_RIGHTRING; break;
case BASE_ITEM_SCIMITAR:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_SCYTHE:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_SHORTBOW:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_SHORTSPEAR:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_SHORTSWORD:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_SHURIKEN:   iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_SLING: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_SMALLSHIELD: iSlot = INVENTORY_SLOT_LEFTHAND; break;
case BASE_ITEM_THROWINGAXE: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_TORCH: iSlot = INVENTORY_SLOT_LEFTHAND; break;
case BASE_ITEM_TOWERSHIELD: iSlot = INVENTORY_SLOT_LEFTHAND; break;
case BASE_ITEM_TWOBLADEDSWORD: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
case BASE_ITEM_WARHAMMER: iSlot = INVENTORY_SLOT_RIGHTHAND; break;
}
return iSlot;
}

void main()
{
object oPC = GetFirstPC();
object oHench = GetHenchman(oPC);
object oSecPC = GetObjectByTag("SECOND_PC");
object oCopy;
object oContainer;
object oItem2;
object oItem = GetFirstItemInInventory(oPC);
// "transit_cont3" ( 1 2 ,
// .. ),
//
if(!GetIsObjectValid(GetItemPossessedBy(oPC, "transit_cont3")))
{
DestroyObject(oHench);
return;
}
AssignCommand(oHench, ClearAllActions());
while (GetIsObjectValid(oItem))
{
///+++
if(GetTag(oItem) == "transit_cont1")
{
oContainer = oItem;
oItem2 = GetFirstItemInInventory(oContainer);
while (GetIsObjectValid(oItem2))
{
oCopy = CopyItem(oItem2, oSecPC, TRUE);
DestroyObject(oItem2);
oItem2 = GetNextItemInInventory(oContainer);
}
DestroyObject(oContainer);
}
///---
///+++
if(GetTag(oItem) == "transit_cont2")
{
oContainer = oItem;
oItem2 = GetFirstItemInInventory(oContainer);
while (GetIsObjectValid(oItem2))
{
oCopy = CopyItem(oItem2, oHench, TRUE);
DestroyObject(oItem2);
oItem2 = GetNextItemInInventory(oContainer);
}
DestroyObject(oContainer);
}
///---
///+++
if(GetTag(oItem) == "transit_cont3")
{
oContainer = oItem;
oItem2 = GetFirstItemInInventory(oContainer);
while (GetIsObjectValid(oItem2))
{
oCopy = CopyItem(oItem2, oHench, TRUE);
SetIdentified(oCopy, TRUE);
AssignCommand(oHench, ActionEquipItem(oCopy, GetSuitableSlot(oCopy)));
DestroyObject(oItem2);
oItem2 = GetNextItemInInventory(oContainer);
}
DestroyObject(oContainer);
}
///---
oItem = GetNextItemInInventory(oPC);
}
// :
DelayCommand(0.5, ExecuteScript("bm_inv_transit4", OBJECT_SELF));
}

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: FileName bm_inv_transit4
//:: 2005 WRG!
//:://////////////////////////////////////////////
/*

*/

//:://////////////////////////////////////////////
//:: Created By: BaaL
//:: Created On:
//:://////////////////////////////////////////////
void main()
{
object oPC = GetFirstPC();
object oSecPC = GetObjectByTag("SECOND_PC");
object oCopy;
object oItem = GetFirstItemInInventory(oSecPC);
while (GetIsObjectValid(oItem))
{
oCopy = CopyItem(oItem, oPC, TRUE);
DestroyObject(oItem);
oItem = GetNextItemInInventory(oSecPC);
}
}

: ][umepa Mar 27 2005, 09:32

NPC . .
1 . ACTION TAKEN

Neverwinter Script Source
void main()
{
object oPC = GetPCSpeaker();
ActionForceFollowObject(oPC, 1.0);
SetLocalObject(OBJECT_SELF, "PC_TO_FOLLOW", oPC);
}


c .
2 OnSpawn SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
// . .
3 OnUserDefined
Neverwinter Script Source
void main()
{
int nEvent = GetUserDefinedEventNumber();
if (nEvent == EVENT_HEARTBEAT)
  {
  object oPC = GetLocalObject(OBJECT_SELF, "PC_TO_FOLLOW");
  // ->
  if(!GetIsObjectValid(oPC) || GetIsInCombat() ) return;
  ActionForceFollowObject(oPC, 1.0);
  }
}


OnUserDefined,
.

: RiPPeR Apr 27 2005, 10:13


" "
" RIPPER'a"


, , "" .

:

.

pl_onlogon.nss ( OnClientEnter )
Neverwinter Script Source
// ===========================================
// pl_on_logon.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

void main()
{
object oPlayer = GetEnteringObject();
object oSpirit = GetPlayerSpirit(oPlayer);
string ID = IntToString(GetLocalInt(oSpirit, "ID"));
string sAccount = GetPCPlayerName(oPlayer);

string sDB_CDKEY = GetCampaignString("db",sAccount+"_CDKEY");
string sPC_CDKEY = GetPCPublicCDKey(oPlayer);

if (GetStringLength(sDB_CDKEY) <= 1) //
SetCampaignString("db",sAccount+"_CDKEY",sPC_CDKEY);
else
if (sDB_CDKEY != sPC_CDKEY)
BootPC(oPlayer);

if (oSpirit == OBJECT_INVALID) //
{
oSpirit = CreateItemOnObject("spirit", GetEnteringObject(), 1);

int nCounter = GetCampaignInt("db","pl_Counter") + 1;

SetLocalInt(oSpirit,"ID",nCounter);
SetCampaignInt("db","pl_Counter",nCounter);

ID = IntToString(nCounter);
}
else //
{
}

SetLocalInt(oSpirit,"bFlaged",1);
SetLocalInt(oSpirit,"bConnected",1);
}


pl_on_logoff.nss ( OnClientLeave )

Neverwinter Script Source
// ===========================================
// pl_on_logoff.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

void main()
{
object oPlayer = GetExitingObject();
object oSpirit = GetPlayerSpirit(oPlayer);

string ID = IntToString(GetLocalInt(oSpirit,"ID"));

SetLocalInt(oSpirit,"bConnected",0);
}


default.nss
Neverwinter Script Source
// ===========================================
// default.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

void main()
{
object oPlayer = OBJECT_SELF;
object oSpirit = GetPlayerSpirit(oPlayer);

vector vPos = GetPosition(oPlayer);

if (GetLocalInt(oSpirit,"bFlaged") == 0)
{
SetLocalFloat(oSpirit,"pos_x",vPos.x);
SetLocalFloat(oSpirit,"pos_y",vPos.y);
SetLocalFloat(oSpirit,"pos_z",vPos.z);
SetLocalFloat(oSpirit,"pos_angle",VectorToAngle(vPos));
}
else
SetLocalInt(oSpirit,"bFlaged",0);
}

main_spirit.nss ( )
Neverwinter Script Source
// ===========================================
// main_spirit.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

object GetPlayerSpirit(object oPlayer);

object GetPlayerSpirit(object oPlayer)
{
object oItem = GetFirstItemInInventory(oPlayer);

if (GetResRef(oItem) == "spirit")
return oItem;

while(oItem != OBJECT_INVALID)
{
oItem = GetNextItemInInventory(oPlayer);

if (GetResRef(oItem) == "spirit")
return oItem;
}
return OBJECT_INVALID;
}


main_active_item.nss
Neverwinter Script Source
// ===========================================
// main_active_item.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

void main()
{
object oPlayer = GetItemActivator();
object oItem = GetItemActivated();
object oTarget = GetItemActivatedTarget();

string sResRef = GetResRef(oItem);
string sTag = GetTag(oItem);

if (sResRef == "dm_wand")
//if (GetIsDM(oPlayer)) //, -
{
AssignCommand(oPlayer,ActionStartConversation(oPlayer,"dm_wand_pl_list",TRUE,FALSE));
ExecuteScript("dm_ban_info",oPlayer);
SpeakString("DM_WAND ACT",TALKVOLUME_SHOUT);
}
}


m_def_loc_enter.nss ( OnEnter __ , __ )
Neverwinter Script Source
// ===========================================
// m_def_loc_enter.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

void main()
{
object oArea = OBJECT_SELF;
object oPlayer = GetEnteringObject();
object oSpirit = GetPlayerSpirit(oPlayer);

string sTag = GetTag(oArea);
string sResRef = GetResRef(oArea);

SetLocalString(oSpirit, "pos_area", sTag);
ExecuteScript(sResRef,oArea); // OnEnter - -'
}

m_loc_saver.nss
22.
:
CODE

====
=**=
=**=
====

= -
* -

.

Neverwinter Script Source
// ===========================================
// m_loc_saver.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

void main()
{
object oPlayer = GetEnteringObject();
object oSpirit = GetPlayerSpirit(oPlayer);

vector vPlayer;
location lPlayer;
object oArea;

float x = GetLocalFloat(oSpirit,"pos_x");
float y = GetLocalFloat(oSpirit,"pos_y");
float z = GetLocalFloat(oSpirit,"pos_z");
float angle = GetLocalFloat(oSpirit,"pos_angle");

string sArea = GetLocalString(oSpirit,"pos_area");

vPlayer = Vector(x,y,z);
oArea = GetObjectByTag(sArea);

lPlayer = Location(oArea,vPlayer,angle);

SetLocalInt(oSpirit,"bConnected",1);
AssignCommand(oPlayer,ActionJumpToLocation(lPlayer));
}

dm_ban_boot.nss
Neverwinter Script Source
// ===========================================
// dm_ban_boot.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

void main()
{
int nID = GetLocalInt(OBJECT_SELF,"DM_WAND_ID");

object oPlayer = GetFirstPC();
object oSpirit;

while (oPlayer != OBJECT_INVALID)
{
oSpirit = GetPlayerSpirit(oPlayer);

if (GetLocalInt(oSpirit,"ID") == nID)
{
BootPC(oPlayer);
break;
}
}
}


dm_ban_info.nss
Neverwinter Script Source
// ===========================================
// dm_ban_info.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

#include "main_spirit"

string PlayerList(object oPC);
object GetPCByPlaceNum(int num);
int GetPCAmount();

string GetGoodEvil(object oPC);
string GetLawChaotic(object oPC);

void main()
{
int num = GetLocalInt(OBJECT_SELF,"DM_WAND_NUM");
int player_amount = GetPCAmount();

if (num == 0)
num = player_amount;

if (num > player_amount)
num = 1;

object oPC = GetPCByPlaceNum(num);
int ID = GetLocalInt(GetPlayerSpirit(oPC),"ID");

SetLocalInt(OBJECT_SELF,"DM_WAND_NUM",num);
SetLocalInt(OBJECT_SELF,"DM_WAND_ID",ID);

string sPlayerList = PlayerList(oPC);

SetCustomToken(1999, sPlayerList);
}

string PlayerList(object oPC)
{
//object oPC = GetFirstPC();
string Text = " \n";

string Account = GetPCPlayerName(oPC);
string Name = GetName(oPC);
string ID = IntToString(GetLocalInt(GetPlayerSpirit(oPC),"ID"));
string CD_KEY = GetPCPublicCDKey(oPC);
string IP = GetPCIPAddress(oPC);

string Level = IntToString(GetLevelByPosition(1, oPC) + GetLevelByPosition(2, oPC) + GetLevelByPosition(3, oPC));
string BadGood = GetGoodEvil(oPC);
string ChaoticLaw = GetLawChaotic(oPC);
string ThisHP = IntToString(GetCurrentHitPoints(oPC));
string MaxHP = IntToString(GetMaxHitPoints(oPC));
string AC = IntToString(GetAC(oPC));

string Area = GetName(GetArea(oPC));

Text += "<c>"+"-----------------------------\n";
Text += "<c>"+": "+"<c>"+Account+"\n";
Text += "<c>"+" : "+"<c>"+Name+"\n";
Text += "<c>"+"ID: "+"<c>"+ID+"\n";
Text += "<c>"+"PUBLIC CD KEY: "+"<c>"+CD_KEY+"\n";
Text += "<c>"+"IP: "+"<c>"+IP+"\n";
Text += "<c>"+"\n";
Text += "<c>"+": "+"<c>"+Level+"\n";
Text += "<c>"+"/: "+"<c>"+BadGood+"\n";
Text += "<c>"+"/: "+"<c>"+ChaoticLaw+"\n";
Text += "<c>"+"HP: "+"<c>"+ThisHP+"/"+"<c>"+MaxHP+"\n";
Text += "<c>"+"AC: "+"<c>"+AC+"\n";
Text += "<c>"+": "+"<c>"+Area+"\n";

return Text;
}

object GetPCByPlaceNum(int num)
{
object oPC = GetFirstPC();
int num2 = 0;

for (num2 = 0; num2 < num - 1; num2++)
oPC = GetNextPC();

return oPC;
}

int GetPCAmount()
{
object oPC = GetFirstPC();
int num = 0;

while (oPC != OBJECT_INVALID)
{
num++;
oPC = GetNextPC();
}

return num;
}

string GetGoodEvil(object oPC)
{
int ret = GetAlignmentGoodEvil(oPC);

if (ret == ALIGNMENT_GOOD)
return "GOOD";

if (ret == ALIGNMENT_EVIL)
return "EVIL";

if (ret == ALIGNMENT_NEUTRAL)
return "NEUTRAL";

return "OBJECT_INVALID";
}

string GetLawChaotic(object oPC)
{
int ret = GetAlignmentLawChaos(oPC);

if (ret == ALIGNMENT_LAWFUL)
return "LAWFUL";

if (ret == ALIGNMENT_CHAOTIC)
return "CHAOTIC";

if (ret == ALIGNMENT_NEUTRAL)
return "NEUTRAL";

return "OBJECT_INVALID";
}

dm_ban_minus.nss
Neverwinter Script Source
// ===========================================
// dm_ban_minus.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

void main()
{
SetLocalInt(OBJECT_SELF,"DM_WAND_NUM",GetLocalInt(OBJECT_SELF,"DM_WAND_NUM") - 1);
ExecuteScript("dm_ban_info",OBJECT_SELF);
ExecuteScript("dm_w_return",OBJECT_SELF);
}

dm_ban_plus.nss
Neverwinter Script Source
// ===========================================
// dm_ban_plus.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

void main()
{
SetLocalInt(OBJECT_SELF,"DM_WAND_NUM",GetLocalInt(OBJECT_SELF,"DM_WAND_NUM") + 1);
ExecuteScript("dm_ban_info",OBJECT_SELF);
ExecuteScript("dm_w_return",OBJECT_SELF);
}

dm_w_return.nss
Neverwinter Script Source
// ===========================================
// dm_w_return.nss 12.12.04
// RiPPeR
// glebkk@xaker.ru
// ===========================================

void main()
{
ExecuteScript("dm_ban_info",OBJECT_SELF);
AssignCommand(OBJECT_SELF,ActionStartConversation(OBJECT_SELF,"dm_wand_pl_list",TRUE,FALSE));
}


- :
-' "dm_wand" .
dm_wand_pl_list

:
CODE

[OWNER] - <CUSTOM1999>
|
(ActionTaken - dm_ban_boot)
(ActionTaken - dm_ban_plus)
(ActionTaken - dm_ban_minus)



, - . smile.gif.

"Spirit", ResRef' "spirit", Undropable

p.s. .

http://glebkk.xaker.ru/Basic.zip

: Aiwan Jun 9 2005, 09:39

. - . .

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: OnEnter am_ten_torch_on
//:: Copyright 2005 WRG!
//:://////////////////////////////////////////////
/*
.

= "AM_PLS_TORCH_ON".
Static.
,
.
. ,
, :
AM_SOUND_TORTCH_( = i).
. !

*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 08.06.2005
//:://///////////////////////////////////////////
#include "am_inc_debug"
void main()
{
int i=1; //
float f=0.5; //
float r=f+0.2; //
object oPC = GetEnteringObject();
string sSound = GetTag(OBJECT_SELF); //
object oTorch = GetFirstObjectInArea(OBJECT_SELF);
object oSound = GetObjectByTag(sSound+IntToString(i)); //
if (!GetIsPC(oPC)) {return;}
//---------------------------------- --------------------------------------
if (GetIsDay() && !GetLocalInt(OBJECT_SELF, "DEACTIVATED"))
  //
{
while (GetIsObjectValid(oTorch))
{
  if (GetTag(oTorch) == "AM_PLS_TORCH_ON" && !GetLocalInt(oTorch, "LIGHT_OFF"))
  /* ,
  , . */

{
SetLocalInt(oTorch, "LIGHT_OFF", TRUE);
AssignCommand(oTorch, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
DelayCommand(f, SetPlaceableIllumination(oTorch, FALSE));
DelayCommand(r, RecomputeStaticLighting(GetArea(oTorch)));
Debug(FloatToString(f));
Debug(FloatToString®);
f=f+0.4; // !
r=f+0.2; // - , .
/* . .
  , , , 0.2,
  . , ,
  . */

}
if (GetIsObjectValid(oSound))
  {
  SoundObjectStop(oSound); //
  i++; //
  }
  oSound = GetObjectByTag("AM_SOUND_TORCH_"+IntToString(i));
  oTorch = GetNextObjectInArea(OBJECT_SELF);
}
  SetLocalInt(OBJECT_SELF, "DEACTIVATED", TRUE);
  }
//----------------------------- -------------------------------------------
if (GetIsNight() && GetLocalInt(OBJECT_SELF, "DEACTIVATED"))
  //
{
while (GetIsObjectValid(oTorch))
{
  if (GetTag(oTorch) == "AM_PLS_TORCH_ON" && GetLocalInt(oTorch, "LIGHT_OFF"))
  {
SetLocalInt(oTorch, "LIGHT_OFF", FALSE);
AssignCommand(oTorch, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
DelayCommand(f, SetPlaceableIllumination(oTorch, TRUE));
DelayCommand(r, RecomputeStaticLighting(GetArea(oTorch)));
Debug(FloatToString(f));
Debug(FloatToString®);
f=f+0.4;
r=f+0.2;
}
if (GetIsObjectValid(oSound))
  {
  SoundObjectPlay(oSound); //
  i++; //
  }
  oSound = GetObjectByTag("AM_SOUND_TORCH_"+IntToString(i));
  oTorch = GetNextObjectInArea(OBJECT_SELF);
}
  SetLocalInt(OBJECT_SELF, "DEACTIVATED", FALSE); //
  return;
  }
}

[mergetime]1118299586[/mergetime]
CODE
, (r) , Debug(FloatToString);

[mergetime]1118299909[/mergetime]
Neverwinter Script Source
//::///////////////////////////////////////////////
//:: Name: am_inc_common
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
         
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan      Aiwan@e-mail.ru
//:: Created On: 30.05.2005
//:://////////////////////////////////////////////

// ( )
// -
// LocalInt - "DEBAG_PC" ,
// LocalInt - "DEBAG_DM" , DM-
void Debug(string message);
// Debug: TAG, ResRef Name .
void DebugObject(object oObject);

//------------------------------------------------------------------------------
void Debug(string message)
{
    object oPC = GetFirstPC();
    if (!GetLocalInt(GetModule(), "DEBAG_PC"))
    {
      SendMessageToPC(oPC, "Debag message: "+message);
    }
    if (!GetLocalInt(GetModule(), "DEBAG_DM"))
          {
            SendMessageToAllDMs("Debag message to DMs: "+message);
          }
}
void DebugObject(object oObject)
{
    string sTag = GetTag(oObject);
    string sResRef = GetResRef(oObject);
    string sName = GetName(oObject);
    Debug ("TAG = "+sTag+", ResRef = "+sResRef+",  Name = "+sName+".");
}
/*
void main(){}


 demo_mod.rar ( 9.63 ) : 73
 

: Buldog Jun 23 2005, 20:21

, , , , , , , , , .

:

Neverwinter Script Source
//////////////////////////////////////
//////////////////////////////////////
//////For Area Transmition Trigers////
//////////////////////////////////////
//////////OnClick Script//////////////
//////////////////////////////////////
////////////Created By Buldog/////////
////////////////23.06.05//////////////
//////////////////////////////////////
//////////////////////////////////////

void main()
{
    object oPC = GetClickingObject();
    object oTarget = GetTransitionTarget(OBJECT_SELF);
    object oTArea = GetArea(oTarget);

    location lTarget;

    vector vPC = GetPosition(oPC);
    vector vTarget = GetPosition(oTarget);
    vector vTLoc = Vector();

    vTLoc.z = vPC.z;

    if(vPC.x < 10.0 || vPC.x > vTarget.x * 2 - 10) vTLoc.x = vTarget.x * 2 - vPC.x;
    else vTLoc.x = vPC.x;

    if(vPC.y < 10.0 || vPC.y > vTarget.y * 2 - 10) vTLoc.y = vTarget.y * 2 - vPC.y;
    else vTLoc.y = vPC.y;

    float fFace = GetFacing(oPC);

    lTarget = Location(oTArea, vTLoc, fFace);

    AssignCommand(oPC, ClearAllActions());
    AssignCommand(oPC, ActionJumpToLocation(lTarget));
}


:

- ( ) .
- , .

:

- ( , ) .
- , .
- () () .

: Aiwan Jun 24 2005, 21:22

. . 10. 30 5 -, 10 1 ...

Neverwinter Script Source
//::///////////////////////////////////////////////
//:: Name: am_inc_dialog
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
         
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan      Aiwan@e-mail.ru
//:: Created On: 22.06.2005
//:://////////////////////////////////////////////
#include "am_inc_debug"

//
// iPercent - . 10%
void GiveXPScale(object oPC, int iPercent=10);

//------------------------------------------------------------------------------
void GiveXPScale(object oPC, int iPercent=10)
{
    object oCreature;
    int iHit = GetHitDice(oPC); //
    int iXP; //
    int i = iHit*1000; //
    iXP= i/iPercent;
    Debug(" - "+IntToString(i));
    Debug(" - "+IntToString(iPercent));
    Debug(" - "+IntToString(iXP));
    /*
    ,
    int iP, . 10%.
    */

    GiveXPToCreature(oPC,iXP);
}
/*
void main(){}

: Friedrich Aug 10 2005, 22:15

makeTrace ( ) , . (.. VFX_FNF_SMOKE_PUFF).
- .

Neverwinter Script Source
// ********************************* //
// * fh_inc_trace                  * //
// * () Friedrich W. Heik, 2005.  * //
// * darkowl@inbox.ru              * //
// ********************************* //

//** Interface **

//
// :
// x - ro: 
// y - fi:  , ( X ..)
// z - psi:
vector sph(vector vDsc);

//
// vSph:
// x - ro: 
// y - fi:  , ( X ..)
// z - psi:
vector dsc(vector vSph);

// .
// . fMagnitude, vVector.
vector setMagnitude(vector vVector, float fMagnitude);

//
// lSource: 
// lTarget: 
// fJump:    , .
// fSpeed:    "", /
// nTraceVFX: ,
// nBurstVFX: (. -1 (VFX_NONE), ) 
void makeTrace(location lSource, location lTarget, float fJump = 0.25f, float fSpeed = 10.0f, int nTraceVFX = VFX_FNF_SMOKE_PUFF, int nBurstVFX = VFX_FNF_FIREBALL);


//** Implementation **

//
// :
// x - ro: 
// y - fi:  , ( X ..)
// z - psi:
vector sph(vector vDsc)
{
  float ro = VectorMagnitude(vDsc);
  float fi = atan(vDsc.y/vDsc.x); // I
  float psi = asin(vDsc.z/ro);

  if (vDsc.x < 0.0) fi += 180.0;      // II, III: +Pi
  else if (vDsc.y < 0.0) fi += 360.0; // IV: +2Pi, smile.gif
  return Vector(ro, fi, psi);
}

//
vector dsc(vector vSph)
{
  float x = vSph.x*cos(vSph.z)*cos(vSph.y); // ro*cos(psi)*cos(fi)
  float y = vSph.x*cos(vSph.z)*sin(vSph.y); // ro*cos(psi)*sin(fi)
  float z = vSph.x*sin(vSph.z); // ro*sin(psi)
  return Vector(x, y, z);
}

vector setMagnitude(vector vVector, float fMagnitude)
{
  vector vSph = sph(vVector);
  vSph.x = fMagnitude;
  return dsc(vSph);
}

void makeTrace(
  location lSource,    //
  location lTarget,    //
  float fJump = 0.25f// , .
  float fSpeed = 10.0f, // "", /
  int nTraceVFX = VFX_FNF_SMOKE_PUFF,
  int nBurstVFX = VFX_FNF_FIREBALL) 
{
  float fInterval = fJump/fSpeed;
  effect eVis = EffectVisualEffect(nTraceVFX);

  vector vOA = GetPositionFromLocation(lSource); // (OA)
  vector vOB = GetPositionFromLocation(lTarget); // (OB)
  vector vAB = vOB - vOA; // (AB) = (OB)-(OA)
 
  //vector vNorm = VectorNormalize(vAB); // , AB
  vector vJump = setMagnitude(vAB, fJump);
 
  vector vCurrent = vOA;
  object oArea = GetAreaFromLocation(lTarget);
  int n = FloatToInt( VectorMagnitude(vAB)/fJump );
  int i;
  float fDelay = 0.0;
  for (i=0; i < n; i++)
  {
    vCurrent += vJump;
    location lCurrent = Location(oArea, vCurrent, 0.0);
    fDelay += fInterval;
    DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lCurrent));
  }
  // Fireball VFX on target:
  if (nBurstVFX != VFX_NONE)
  {
    fDelay += fInterval;
    effect eBurst = EffectVisualEffect(nBurstVFX);
    DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBurst, lTarget));
  }
}
//void main(){}


, :
Neverwinter Script Source
void setGoodEvilValue(object oCreature, int nValue)
{
  if(!GetIsObjectValid(oCreature)||
    (GetObjectType(oCreature) != OBJECT_TYPE_CREATURE))
    return;
 
  if (nValue < 0) nValue = 0;
  else if (nValue > 100) nValue = 100;
 
  int nCurGE = GetGoodEvilValue(oCreature);
  int nShift = abs(nCurGE - nValue);
  if (nShift == 0) return;
  int nDir = (nValue > nCurGE) ? ALIGNMENT_GOOD : ALIGNMENT_EVIL;
  AdjustAlignment(oCreature, nDir, nShift);
  if (GetGoodEvilValue(oCreature) != nValue)
    setGoodEvilValue(oCreature, nValue);
}

void setLawChaosValue(object oCreature, int nValue)
{
  if(!GetIsObjectValid(oCreature)||
    (GetObjectType(oCreature) != OBJECT_TYPE_CREATURE))
    return;
 
  if (nValue < 0) nValue = 0;
  else if (nValue > 100) nValue = 100;
 
  int nCurLC = GetLawChaosValue(oCreature);
  int nShift = abs(nCurLC - nValue);
  if (nShift == 0) return;
  int nDir = (nValue > nCurLC) ? ALIGNMENT_LAWFUL : ALIGNMENT_CHAOTIC;
  AdjustAlignment(oCreature, nDir, nShift);
  if (GetLawChaosValue(oCreature) != nValue)
    setLawChaosValue(oCreature, nValue);
}
//void main(){}

- .

: DraX Aug 12 2005, 11:16

. , , :

Neverwinter Script Source
if(GetLocalInt(OBJECT_SELF, "DO_ONCE") != 1)
{
string sTag = "OBJECT"//
num nNum = 1// 1

for(nNum = 1; nNum <= 4; nNum++)  // 4 - -
{
  int nNum2 = nNum++;

  if(nNum2 > 4)
    nNum2 = 1;

  object oStart = GetObjectByTag(sTag + "_" + nNum);
  object oEnd = GetObjectByTag(sTag + "_" + Num2);

  ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectBeam(VFX_BEAM_FIRE, oEnd, BODY_NODE_CHEST), oStart);
}

SetLocalInt(OBJECT_SELF, "DO_ONCE", 1);
}


, Aiwan. - . OnHeartbeat .

:

: 2_advanced Aug 30 2005, 15:11

, , // ..

Neverwinter Script Source
void RestEnd()
{
object oPC = OBJECT_SELF;

int nRez = GetLocalInt(oPC, "LastEventRest"); // ?

DeleteLocalInt(oPC, "LastEventRest");
DeleteLocalLocation(oPC, "RestLocation");

if(!nRez) //
return;

FadeFromBlack(oPC, FADE_SPEED_SLOWEST); //

object oBedroll = GetLocalObject(oPC, "bedroll");
if(GetIsObjectValid(oBedroll))
{
DestroyObject(oBedroll, 3.5f);
CreateItemOnObject(BEDROLL_IT_RES, oPC);
DeleteLocalObject(oPC, "bedroll");
}
}

void RestFinish()
{
object oPC = OBJECT_SELF;

if(!GetLocalInt(oPC, "LastEventRest"))
return;

DeleteLocalInt(oPC, "NextRest");

ActionMoveToLocation(GetLocation(oPC)); // stand up tongue.gif

//todo: - . ..
ForceRest(oPC);
//todo:

SendMessageToPC(oPC, "<c> ..</c>");

if(!GetLocalInt(oPC, "REST_DONT_SLEEP"))
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD);

RestEnd();
}

void RestFailCheck() // check chance to rest // c:RestBegin: random(restduration)
{
object oPC = OBJECT_SELF;
object oArea = GetArea(oPC);

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oPC);

if(!GetLocalInt(oPC, "LastEventRest"))
return;

if(!GetIsObjectValid(oArea))
return;

object oPC2 = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); // -
if(oPC2 != OBJECT_INVALID && !GetIsEnemy(oPC, oPC2) && GetDistanceBetween(oPC, oPC2) < 10.0)
return;

object oChance = GetNearestObjectByTag(REST_CHANCE_PL_TAG);
if(oChance == OBJECT_INVALID)
return;

int nChance = GetLocalInt(oChance, "REST_CHANCE");

if(!nChance || (nChance >= d100()))
return;

RestEnd();
}

void RestThread() // cancel rest checks tongue.gif // c:RestBegin
{
object oPC = OBJECT_SELF;

if(!GetLocalInt(oPC, "LastEventRest")) //
return;

//
object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
if( GetLocation(oPC) != GetLocalLocation(oPC, "RestLocation") ||
(GetIsObjectValid(oEnemy) && GetDistanceBetween(oEnemy, oPC) < 15.0) )
{
SendMessageToPC(oPC, "<c> .</c>");
RestEnd();
return;
}

if(GetLocalInt(oPC, "REST_DONT_SLEEP"))
ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 3.0);
else
ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 3.0);

AssignCommand(oPC, DelayCommand(3.0f, RestThread())); //
}

void NextRestTimer() // proc. 4 min. for failed rest // c:RestBegin
{
object oPC = OBJECT_SELF;

int nCurr = GetLocalInt(oPC, "NextRest");

if(nCurr)
{
if(!GetLocalInt(oPC, "LastEventRest"))
SetLocalInt(oPC, "NextRest", nCurr - 1);

AssignCommand(oPC, DelayCommand(30.0, NextRestTimer())); // ( ): 8 * 30 = 4
}
}

void RestBegin(float fSeconds)
{
object oPC = OBJECT_SELF;

ClearAllActions();

SetLocalInt(oPC, "NextRest", 8); //
SetLocalInt(oPC, "LastEventRest", 1); // ?!
SetLocalLocation(oPC, "RestLocation", GetLocation(oPC));

AssignCommand(oPC, DelayCommand(30.0f, NextRestTimer()));
AssignCommand(oPC, DelayCommand(3.0f + fSeconds, RestFinish())); //
AssignCommand(oPC, DelayCommand(3.0f, RestThread())); //

DelayCommand(3.5f, FadeToBlack(oPC, FADE_SPEED_MEDIUM));
}

void main()
{
object oPC = GetLastPCRested();

if(GetIsDM(oPC) || GetIsDMPossessed(oPC))
{
ForceRest(oPC);
return;
}

object oMod = GetModule();

if(GetLocalInt(oPC, "LastEventRest")) // .
{
AssignCommand(oPC, ClearAllActions());

if(GetLocalInt(oPC, "REST_DONT_SLEEP"))
DelayCommand(0.1f, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 3.0));
else
DelayCommand(0.1f, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 3.0));

return;
}


int nNextRest = GetLocalInt(oPC, "NextRest");
if(nNextRest)
{
AssignCommand(oPC, ClearAllActions());
SendMessageToPC(oPC, "<c> " + IntToString(nNextRest/2) + " </c>");
return;
}


object oChance = GetNearestObjectByTag(REST_CHANCE_PL_TAG); // smile.gif
if(oChance != OBJECT_INVALID)
{
int nChance = GetLocalInt(oChance, "REST_CHANCE");
if(!nChance)
{
AssignCommand(oPC, ClearAllActions());
SendMessageToPC(oPC, "<c0> .</c>");
return;
}
}

switch(GetLastRestEventType())
{
case REST_EVENTTYPE_REST_STARTED:
int nDelay = REST_DELAY;
int nLastRest = GetActionLastTime(oPC, "REST");

if(nLastRest < nDelay)
{
FloatingTextStringOnCreature("<c> .</c>", oPC, 0);
SendMessageToPC(oPC, "<c0> " + IntToString(nDelay - nLastRest - 1) + ":" + IntToString(59-GetTimeMinute()) + " () .</c>");
AssignCommand(oPC, ClearAllActions());
return;
}

//
oBedroll = GetItemPossessedBy(oPC, BEDROLL_IT_RES);
if(GetClassByPosition(1, oPC) == CLASS_TYPE_MONK || GetRacialType(oPC) == RACIAL_TYPE_ELF)
{
SetLocalInt(oPC, "REST_DONT_SLEEP", 1);
}
else
if(GetIsObjectValid(oBedroll))
{
DestroyObject(oBedroll);
oBedroll = CreateObject(OBJECT_TYPE_PLACEABLE, BEDROLL_PL_RES, GetLocation(oPC));
SetLocalObject(oPC, "bedroll", oBedroll);
}
else
{
SendMessageToPC(oPC, "<c> .</c>");
AssignCommand(oPC, ClearAllActions());
return;
}

// smile.gif
object oCamp = GetNearestObjectByTag(CAMPFIRE_PL_RES, oPC);
if(GetIsDay() || (GetIsObjectValid(oCamp) && GetDistanceBetween(oCamp, oPC) < 4.5))
SetLocalInt(oPC, "REST_CAMPFIRE", 1);

// 2
int nRestDuration = StringToInt(Get2DAString("restduration", "DURATION", GetHitDice(oPC)));
if(nRestDuration)
{
float fCheckDelay = IntToFloat(nRestDuration)/1000.0f;

DelayCommand(0.1f, AssignCommand(oPC, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_LEFTHAND)))); //
DelayCommand(0.2f, AssignCommand(oPC, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND))));
DelayCommand(0.4f, AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 2.7))); //
DelayCommand(0.0f, AssignCommand(oPC, RestBegin(fCheckDelay))); // .

DelayCommand(IntToFloat(Random(nRestDuration))/1000.0f, AssignCommand(oPC, RestFailCheck())); // .. tongue.gif
}

break;
}
}

onEnter:
Neverwinter Script Source
DeleteLocalInt(oPC, "NextRest");
DeleteLocalInt(oPC, "LastEventRest");

15:18
..

Neverwinter Script Source
void SetActionLastTime(object oPC, string sAction)
{
string sPCName = GetPCPlayerName(oPC); // ..

int nHour = GetTimeHour();
int nDay = GetCalendarDay();
int nMonth = GetCalendarMonth();
int nYear = GetCalendarYear();

string sData = IntToString(nHour) + ";" + IntToString(nDay) + ";" + IntToString(nMonth) + ";" + IntToString(nYear) + ";";

SetLocalString(GetModule(), sAction + sPCName, sData);
}

int GetActionLastTime(object oPC, string sAction)
{
string sPair;
string sPCName = GetPCPlayerName(oPC);
string sData = GetLocalString(GetModule(), sAction + sPCName);

if(sData == "")
{
return 100;
}

int nLastMinute;
int nLastHour;
int nLastDay;
int nLastMonth;
int nLastYear;

int i;
for(i=0; i<5; i++)
{
int nPos = FindSubString(sData, ";"); // . php explode? biggrin.gif
if(nPos != -1)
{
sPair = GetStringLeft(sData, nPos);
sData = GetStringRight(sData, GetStringLength(sData) - 1 - nPos);

switch(i)
{
case 0: nLastHour  = StringToInt(sPair); break;
case 1: nLastDay = StringToInt(sPair); break;
case 2: nLastMonth = StringToInt(sPair); break;
case 3: nLastYear  = StringToInt(sPair); break;
}
}
}

int nMinute = GetTimeMinute();
int nHour = GetTimeHour();
int nDay = GetCalendarDay();
int nYear = GetCalendarYear();
int nMonth = GetCalendarMonth();

if(nLastYear != nYear)
nMonth = nMonth + 12;

if(nLastMonth != nMonth)
nDay = nDay + 28 * (nYear - nLastYear);

if(nDay != nLastDay)
nHour = nHour + 24 * (nDay - nLastDay);

return (nHour - nLastHour);
}

: Aiwan Sep 20 2005, 08:57

. . . OnPlayerLevelUp .

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: OnPlayerLevelUp  "am_mod_levelup"
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
 
  . Dumbo
  , pardon.gif.
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 20.09.2005
//:://////////////////////////////////////////////
void main()
{
    object oPC = GetFirstPC();
    int iHit = GetHitDice(oPC); //
    int iXP = GetXP(oPC); //
    string sClass; //
    int iClass2 = GetClassByPosition(2, oPC); //
    int iClass3 = GetClassByPosition(3, oPC); //  
    int F = CLASS_TYPE_FIGHTER; //
    int R = CLASS_TYPE_ROGUE;  //
    int D = CLASS_TYPE_DRUID;  //
    int P = CLASS_TYPE_PALADIN; // ...

    // s: , , ,
    if  ((iClass2==F || iClass3==F) || (iClass2==R || iClass3==R)
      || (iClass2==D || iClass3==D) || (iClass2==P || iClass3==P))
      {
          if(iClass2==F || iClass3==F) sClass = "";
          if(iClass2==R ||  iClass3==R) sClass = "";
          if(iClass2==D || iClass3==D) sClass = "";
          if(iClass2==P || iClass3==P) sClass = "";

        // ,
        // , . ,
        // ,
        // .
        SetXP(oPC, (iHit*(iHit-1)*500)-((iHit-1)*1000));
        DelayCommand(0.5, SetXP(oPC, iXP));

        // , - .
        SendMessageToPC(oPC, " : "+sClass);

        /*
          - , .
        */

      }
}

: 2_advanced Oct 26 2005, 19:42

, ..,
( , )

. sittingsurface

Neverwinter Script Source
void main()
{
    object oPC = GetLastUsedBy();
    object oChair = OBJECT_SELF;

    if(GetIsObjectValid(oChair) && GetIsObjectValid(oPC))
    {
        object oSurf = GetLocalObject(oChair, "surf");

        if(GetIsObjectValid(oSurf))
        {
            object oSitter = GetSittingCreature(oSurf);

            if(!GetIsObjectValid(oSitter) || GetArea(oSitter) != GetArea(oChair))
                DestroyObject(oSurf);
            else
                return;
        }

        vector vSurf = GetPosition(oChair);
        vSurf.z = 0.0;

        location lSurf = Location(GetArea(oChair), vSurf, GetFacing(oChair));

        object oNewSurf = CreateObject(OBJECT_TYPE_PLACEABLE, "sittingsurface", lSurf, FALSE);

        SetLocalObject(oChair, "surf", oNewSurf);

        AssignCommand(oPC, ActionSit(oNewSurf));
    }
}
: * * , ( 1.29 _), 1 ( pardon.gif) .
< swoon.gif >

: Aiwan Nov 2 2005, 00:18

. , . . ...

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: ActionTaken  am_at_npc_step
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
  NPC ,
  .
  .
*/

//:://///////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 01.10.2005
//:://///////////////////////////////////////////
//:: CreateRandomLocation Function by Baal
//:://///////////////////////////////////////////
location CreateRandomLocation(object oTarget, float fRadius, int bOnLine = TRUE)
{
if(!bOnLine)
fRadius=IntToFloat(Random(FloatToInt(fRadius)));

float iXO=VectorMagnitude(GetPosition(oTarget))*cos(VectorToAngle(GetPosition(oTarget)));
float iYO=VectorMagnitude(GetPosition(oTarget))*sin(VectorToAngle(GetPosition(oTarget)));
float fRndomAngle=IntToFloat(Random(360));
location lNEW=Location(GetArea(oTarget),Vector(iXO+fRadius*cos(fRndomAngle),iYO+fRadius*sin(fRndomAngle)),360.0);
return lNEW;
}
//:://///////////////////////////////////////////

void main()
{
    object oPC = GetPCSpeaker(); //
    object oSelf = OBJECT_SELF; //
    location lFree = CreateRandomLocation(oSelf, 5.0);
    // 5
    int iRun = FALSE; //

    if(GetLocalInt(oSelf, "RUN"))
      {
        iRun = TRUE; // "RUN" , .
      }
    AssignCommand(oSelf, ClearAllActions()); //
    AssignCommand(oSelf, ActionMoveToLocation(lFree, iRun));
    // ActionMove, "" .
    AssignCommand(oSelf, ActionDoCommand(SetFacingPoint(GetPosition(oPC))));
}

: Aiwan Nov 8 2005, 15:13

. , . . . good.gif

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: OnEnter  am_ahb_day_night
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
  /. OnUserDefined
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Edit By: Lex
//:: Created On: 24.05.2005
//:://///////////////////////////////////////////
//#include "am_inc_common"
void main()
{
object oPC = GetFirstPC();
if (GetArea(oPC) != OBJECT_SELF) return;

if (GetIsDusk()||GetIsNight())
    {
    if (GetLocalInt(OBJECT_SELF, "Night") != 1)
        {
        SetLocalInt(OBJECT_SELF, "Day", 0);
        SetLocalInt(OBJECT_SELF, "Night", 1);
        SignalEvent(OBJECT_SELF, EventUserDefined(3000));
        return;
        }
    else return;
    }
if (GetIsDawn()||GetIsDay())
    {
    if (GetLocalInt(OBJECT_SELF, "Day") != 1)
        {
        SetLocalInt(OBJECT_SELF, "Night", 0);
        SetLocalInt(OBJECT_SELF, "Day", 1);
        SignalEvent(OBJECT_SELF, EventUserDefined(1000));
        return;
        }
    else return;
    }
}


Neverwinter Script Source
//:://////////////////////////////////////////////
//:: ActionTaken  lm_aud_enc_activ
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
    . .
  LocalInt(oEnc, "ENCOUNTER_SPAWN_NIGHT") - .
  LocalInt(oEnc, "ENCOUNTER_SPAWN_DAY") - .
*/

//:://///////////////////////////////////////////
//:: Created By: Lex
//:: Created On: 08.11.2005
//:://///////////////////////////////////////////

void EncounterController(int ActivateStatus, object oArea = OBJECT_SELF)
{
int nEN = GetLocalInt(oArea,"ENCOUNTERS");
object oEncounter;
while (nEN > 0)
    {
    oEncounter = GetLocalObject(oArea,"ENCOUNTER_"+IntToString(nEN));
    if(GetLocalInt(oEncounter, "ENCOUNTER_SPAWN_NIGHT"))
        SetEncounterActive(!ActivateStatus, oEncounter);
    else  if(GetLocalInt(oEncounter, "ENCOUNTER_SPAWN_DAY"))
        SetEncounterActive(ActivateStatus, oEncounter);
    nEN--;
    }
}

void main()
{
  int nEvent = GetUserDefinedEventNumber();
  int ActivateStatus;
  int nEN = GetLocalInt(OBJECT_SELF,"ENCOUNTERS");
  if (nEN == 0)
      {
      object oEnc = GetFirstObjectInArea(OBJECT_SELF);
      while (GetIsObjectValid(oEnc))
          {
            if(GetObjectType(oEnc) == OBJECT_TYPE_ENCOUNTER)
                {
                nEN++;
                SetLocalObject(OBJECT_SELF,"ENCOUNTER_"+IntToString(nEN),oEnc);
                }
            oEnc = GetNextObjectInArea(OBJECT_SELF);
          }
      if (nEN == 0) nEN = -1;
      SetLocalInt(OBJECT_SELF,"ENCOUNTERS",nEN);
      }
if (nEvent == 1000) //
  {
  if (nEN == -1) return;
  EncounterController(TRUE);
  return;
  }
if (nEvent == 3000) //
  {
  if (nEN == -1) return;
  EncounterController(FALSE);
  return;
  }
}

[mergetime]1131452068[/mergetime]
, ! scratch_one-s_head.gif . .

: Aiwan Nov 14 2005, 14:45

+ ERF , . , - , , , . . . ? 5 , . , , , , . () , OBJECT_SEL, .

:
DEACTIVATED == 1 . , , . , , .. ? 0 .
LOCAL_NPC_01 - . : _01

Neverwinter Script Source
SetLocalInt(oNPC, "", 1);
SetLocalInt(oNPC, "_", 2);

LOCAL_PC_01 - P. : _01
Neverwinter Script Source
SetLocalInt(oPC, "", 1);
SetLocalInt(oPC, "_", 5);

RUN_SCRIPT - _ - OBJECT_SELF
Neverwinter Script Source
ExecuteScript("_", OBJECT_SELF);

RUN_SCRIPT_ON_NPC - _ - oNpc
Neverwinter Script Source
ExecuteScript("_", oNpc);

.
TAG_NPC - .
TAG_WP_TO_JUMP - . , .
. .

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: OnEnter  am_ten_test
//:: Copyright 2005 WRG!
//:://////////////////////////////////////////////
/*
   
*/

//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 11.11.2005
//:://////////////////////////////////////////////
//#include "sz_inc_common"
#include "am_inc_debug"

void main()
{
object oPC = GetEnteringObject(); // PC
object oSelf = OBJECT_SELF;
string sNpc = GetLocalString(oSelf, "TAG_NPC");
string sWp = GetLocalString(oSelf, "TAG_WP_TO_JUMP");
object oNpc = GetObjectByTag(sNpc);
object oWp = GetWaypointByTag(sWp);

if(GetLocalInt(oSelf, "DEACTIVATED")==2)
  return;
/*
//------------------------------------------------------------------------------
  SlavaZ-,
  .

//------------------------------ #1 --------------------------------------
string sQ1 = GetLocalString(oSelf, "QUEST_01");
string sQuest1 = GetStringLeft(sQ1, GetStringLength(sQ1)-3);
int iQ1 = StringToInt(GetStringRight(sQ1, 2));
//------------------------------ #2 --------------------------------------
string sQ2 = GetLocalString(oSelf, "QUEST_02");
string sQuest2 = GetStringLeft(sQ2, GetStringLength(sQ2)-3);
int iQ2 = StringToInt(GetStringRight(sQ2, 2));
//------------------------------ #3 --------------------------------------
string sQ3 = GetLocalString(oSelf, "QUEST_03");
string sQuest3 = GetStringLeft(sQ3, GetStringLength(sQ3)-3);
int iQ3 = StringToInt(GetStringRight(sQ3, 2));
//------------------------------ #4 --------------------------------------
string sQ4 = GetLocalString(oSelf, "QUEST_04");
string sQuest4 = GetStringLeft(sQ4, GetStringLength(sQ4)-3);
int iQ4 = StringToInt(GetStringRight(sQ4, 2));
//------------------------------ #5 --------------------------------------
string sQ5 = GetLocalString(oSelf, "QUEST_05");
string sQuest5 = GetStringLeft(sQ5, GetStringLength(sQ5)-3);
int iQ5 = StringToInt(GetStringRight(sQ5, 2));

  if(sQ1!=""){
  SetQuestStatus(sQuest1, iQ1, TRUE);
  Debug(" QUEST: "+sQuest1+" == "+IntToString(iQ1));}
  if(sQ2!=""){
  SetQuestStatus(sQuest2, iQ2, TRUE);
  Debug(" QUEST: "+sQuest2+" == "+IntToString(iQ2));}
  if(sQ3!=""){
  SetQuestStatus(sQuest3, iQ3, TRUE);
  Debug(" QUEST: "+sQuest3+" == "+IntToString(iQ3));}
  if(sQ4!=""){
  SetQuestStatus(sQuest4, iQ4, TRUE);
  Debug(" QUEST: "+sQuest4+" == "+IntToString(iQ4));}
  if(sQ5!=""){
  SetQuestStatus(sQuest5, iQ5, TRUE);
  Debug(" QUEST: "+sQuest5+" == "+IntToString(iQ5));}
*/

//------------------------------------------------------------------------------
//                 
//------------------------------------------------------------------------------

//--------------------------- #1 ------------------------------------
string sL1 = GetLocalString(oSelf, "LOCAL_PC_01");
string sLocal1 = GetStringLeft(sL1, GetStringLength(sL1)-3);
int iL1 = StringToInt(GetStringRight(sL1, 2));
//--------------------------- #2 ------------------------------------
string sL2 = GetLocalString(oSelf, "LOCAL_PC_02");
string sLocal2 = GetStringLeft(sL2, GetStringLength(sL2)-3);
int iL2 = StringToInt(GetStringRight(sL2, 2));
//--------------------------- #3 ------------------------------------
string sL3 = GetLocalString(oSelf, "LOCAL_PC_03");
string sLocal3 = GetStringLeft(sL3, GetStringLength(sL3)-3);
int iL3 = StringToInt(GetStringRight(sL3, 2));
//--------------------------- #4 ------------------------------------
string sL4 = GetLocalString(oSelf, "LOCAL_PC_04");
string sLocal4 = GetStringLeft(sL4, GetStringLength(sL4)-3);
int iL4 = StringToInt(GetStringRight(sL4, 2));
//--------------------------- #5 ------------------------------------
string sL5 = GetLocalString(oSelf, "LOCAL_PC_05");
string sLocal5 = GetStringLeft(sL5, GetStringLength(sL5)-3);
int iL5 = StringToInt(GetStringRight(sL5, 2));

  if(sL1!=""){
  SetLocalInt(oPC, sLocal1, iL1);
  Debug(" LocalInt: "+sLocal1+" == "+IntToString(iL1));}
  if(sL2!=""){
  SetLocalInt(oPC, sLocal2, iL2);
  Debug(" LocalInt: "+sLocal2+" == "+IntToString(iL2));}
  if(sL3!=""){
  SetLocalInt(oPC, sLocal3, iL3);
  Debug(" LocalInt: "+sLocal3+" == "+IntToString(iL3));}
  if(sL4!=""){
  SetLocalInt(oPC, sLocal4, iL4);
  Debug(" LocalInt: "+sLocal4+" == "+IntToString(iL4));}
  if(sL5!=""){
  SetLocalInt(oPC, sLocal5, iL5);
  Debug(" LocalInt: "+sLocal5+" == "+IntToString(iL5));}

//------------------------------------------------------------------------------
//                 
//------------------------------------------------------------------------------

//--------------------------- #1 ------------------------------------
string sLn1 = GetLocalString(oSelf, "LOCAL_NPC_01");
string sLocalN1 = GetStringLeft(sLn1, GetStringLength(sLn1)-3);
int iLn1 = StringToInt(GetStringRight(sLn1, 2));
//--------------------------- #2 ------------------------------------
string sLn2 = GetLocalString(oSelf, "LOCAL_NPC_02");
string sLocalN2 = GetStringLeft(sLn2, GetStringLength(sLn2)-3);
int iLn2 = StringToInt(GetStringRight(sLn2, 2));
//--------------------------- #3 ------------------------------------
string sLn3 = GetLocalString(oSelf, "LOCAL_NPC_03");
string sLocalN3 = GetStringLeft(sLn3, GetStringLength(sLn3)-3);
int iLn3 = StringToInt(GetStringRight(sLn3, 2));
//--------------------------- #4 ------------------------------------
string sLn4 = GetLocalString(oSelf, "LOCAL_NPC_04");
string sLocalN4 = GetStringLeft(sLn4, GetStringLength(sLn4)-3);
int iLn4 = StringToInt(GetStringRight(sLn4, 2));
//--------------------------- #5 ------------------------------------
string sLn5 = GetLocalString(oSelf, "LOCAL_NPC_05");
string sLocalN5 = GetStringLeft(sLn5, GetStringLength(sLn5)-3);
int iLn5 = StringToInt(GetStringRight(sLn5, 2));

  if(sLn1!=""){
  SetLocalInt(oNpc, sLocalN1, iLn1);
  Debug(" "+GetName(oNpc)+" LocalInt: "+sLocalN1+" == "+IntToString(iLn1));}
  if(sLn2!=""){
  SetLocalInt(oNpc, sLocalN2, iLn2);
  Debug(" "+GetName(oNpc)+" LocalInt: "+sLocalN2+" == "+IntToString(iLn2));}
  if(sLn3!=""){
  SetLocalInt(oNpc, sLocalN3, iLn3);
  Debug(" "+GetName(oNpc)+" LocalInt: "+sLocalN3+" == "+IntToString(iLn3));}
  if(sLn4!=""){
  SetLocalInt(oNpc, sLocalN4, iLn4);
  Debug(" "+GetName(oNpc)+" LocalInt: "+sLocalN4+" == "+IntToString(iLn4));}
  if(sLn5!=""){
  SetLocalInt(oNpc, sLocalN5, iLn5);
  Debug(" "+GetName(oNpc)+" LocalInt: "+sLocalN5+" == "+IntToString(iLn5));}
//------------------------------------------------------------------------------
// . , .
//------------------------------------------------------------------------------
  if(sNpc!="" && !GetIsObjectValid(oNpc))
    {
      Debug("! !");
    }
  if(sWp!="")
  {
      if(!GetIsObjectValid(oWp))
        {
          Debug("! !");
          return;
        }
      AssignCommand(oNpc, ClearAllActions());
      AssignCommand(oNpc, JumpToObject(oWp));
  }
//------------------------------------------------------------------------------
//  , .
//------------------------------------------------------------------------------
string sScOnPC = GetLocalString(oSelf, "RUN_SCRIPT_ON_PC");
string sScOnNpc = GetLocalString(oSelf, "RUN_SCRIPT_ON_NPC");
string sScOnSelf = GetLocalString(oSelf, "RUN_SCRIPT");

if(sScOnPC!="")
{
  ExecuteScript(sScOnPC, oPC);
  Debug(" "+sScOnPC+" ");
}
if(sScOnNpc!="")
{
  ExecuteScript(sScOnNpc, oNpc);
  Debug(" "+sScOnNpc+" "+GetName(oNpc));
}
if(sScOnSelf!="")
{
  ExecuteScript(sScOnSelf, oSelf);
  Debug(" "+sScOnSelf+" OBJECT_SELF");
}
//------------------------------------------------------------------------------
//                , .
//------------------------------------------------------------------------------
if(GetLocalInt(oSelf, "DEACTIVATED")==1)
  SetLocalInt(oSelf, "DEACTIVATED", 2);
}


http://www.wrg.ru/TEMP/Aiwan/am_tr_test.erf.rar


 

: -fenix- Nov 16 2005, 14:10

, , , . ? . crazy.gif

?
/ .
:
, 10 .
100 .
100% (10), 100% (100).
50% (5), 50% (50). ( ), , , .
, , .
.
: OnDamaged , OnDeath . . , , , . , , . , , , , . smile.gif
, .


OnDamaged

Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Created By: -fenix-
//:: Created On: 16.11.2005
//:://////////////////////////////////////////////

void main()
{
object oDamager = GetLastDamager();
int iMaxHit = GetMaxHitPoints();
int iCurHit = GetCurrentHitPoints();
string sNamePC = GetName(oDamager);
int i,Z, iDamage;

if(GetIsPC(oDamager))//
{
    //,
    for(i = 1; i <= GetLocalInt(OBJECT_SELF, "KOLICHESTVO"); i ++)
    {
        //
        if(sNamePC == GetLocalString(OBJECT_SELF, "NAME_PC_" + IntToString(i)))
        {
            // ( )
            if(iCurHit < 0)
            {
                iDamage = iMaxHit;
            }
            else
            {
                iDamage = iMaxHit - iCurHit;
            }
            // -
            SetLocalInt(OBJECT_SELF, IntToString(i) + "_DamagePC", (iDamage - GetLocalInt(OBJECT_SELF, "DamageAll")) + GetLocalInt(OBJECT_SELF, IntToString(i) + "_DamagePC"));
            //
            SetLocalInt(OBJECT_SELF, "DamageAll", GetLocalInt(OBJECT_SELF, "DamageAll") + (iDamage - GetLocalInt(OBJECT_SELF, "DamageAll")));
            // . ,
            SendMessageToPC(oDamager, GetLocalString(OBJECT_SELF, "NAME_PC_" + IntToString(i)) + "_1_" + IntToString(GetLocalInt(OBJECT_SELF, IntToString(i) + "_DamagePC")));
            // . ,
            SendMessageToPC(oDamager, "DamageAll1="
            IntToString(GetLocalInt(OBJECT_SELF, "DamageAll")));
            Z = 1;// ,
        }
    }
    //
    if(Z != 1)
    {
        // ( )
        if(iCurHit < 0)
        {
            iDamage = iMaxHit;
        }
        else
        {
            iDamage = iMaxHit - iCurHit;
        }
        // ""
        SetLocalInt(OBJECT_SELF, "KOLICHESTVO", GetLocalInt(OBJECT_SELF, "KOLICHESTVO") + 1);
        //
        SetLocalString(OBJECT_SELF, "NAME_PC_" +
IntToString(GetLocalInt(OBJECT_SELF, "KOLICHESTVO")), sNamePC);
        // -
        SetLocalInt(OBJECT_SELF, IntToString(GetLocalInt(OBJECT_SELF
"KOLICHESTVO")) + "_DamagePC", (iDamage - GetLocalInt(OBJECT_SELF"DamageAll")));
        //
        SetLocalInt(OBJECT_SELF, "DamageAll", GetLocalInt(OBJECT_SELF,
"DamageAll") + GetLocalInt(OBJECT_SELF,
      IntToString(GetLocalInt(OBJECT_SELF, "KOLICHESTVO")) + "_DamagePC"));

/* . , */                     
SendMessageToPC(oDamager,GetLocalString(OBJECT_SELF,"NAME_PC_"+IntToString(GetLocalInt(OBJECT_SELF,"KOLICHESTVO")))
+"_2_"+IntToString(GetLocalInt(OBJECT_SELF,IntToString(GetLocalInt(OBJECT_SELF,"KOLICHESTVO"))+"_DamagePC")));
        // . ,
        SendMessageToPC(oDamager, "DamageAll2=" + IntToString(GetLocalInt(OBJECT_SELF, "DamageAll")));
    }
}
else//
{
    // ( )
    if(iCurHit < 0)
    {
        iDamage = iMaxHit;
    }
    else
    {
        iDamage = iMaxHit - iCurHit;
    }
    //
    SetLocalInt(OBJECT_SELF, "DamageAll", (iDamage - GetLocalInt(OBJECT_SELF,       
    "DamageAll")) + GetLocalInt(OBJECT_SELF, "DamageAll"));
    // . ,
    SendMessageToPC(GetFirstPC(), " _" +         
    IntToString(GetLocalInt(OBJECT_SELF, "DamageAll")));
}
}


OnDeath . .
Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Created By: -fenix-
//:: Created On: 16.11.2005
//:://////////////////////////////////////////////

void main()
{
int iMaxHit = GetMaxHitPoints();
int iMaxXP = 100;// -
int i, S, iXPPC;

//
for(i = 1; i <= GetLocalInt(OBJECT_SELF, "KOLICHESTVO"); i ++)
{
    object oPC = GetFirstPC();

    while(S != 100)
    {
        string sNamePC = GetName(oPC);
        //
        if(sNamePC == GetLocalString(OBJECT_SELF, "NAME_PC_" + IntToString(i)))
        {
          // -
          iXPPC=((100 * GetLocalInt(OBJECT_SELF, IntToString(i) + "_DamagePC") / iMaxHit) * iMaxXP) / 100;
            // , 1
            if(iXPPC <1)
            {
                iXPPC = 1;
            }
            GiveXPToCreature(oPC, iXPPC);//
            S = 100;
        }
        oPC = GetNextPC();
    }
    S = 0;
}
}

- . . .
Neverwinter Script Source
//:://////////////////////////////////////////////
//:: Created By: -fenix-
//:: Created On: 20.10.2005
//:://////////////////////////////////////////////

void main()
{
object oPC = GetLastDamager();
int iMaxHit = GetMaxHitPoints();
int iCurHit = GetCurrentHitPoints();


if(GetIsPC(oPC))
{
    int i, j;

    for(i = 1; i = j; i ++)
    {
        if(GetName(oPC) == GetLocalString(OBJECT_SELF, IntToString(i)))
        {
            int iDamage = iMaxHit - iCurHit;

            SetLocalInt(OBJECT_SELF, "DamagePC", (iDamage - GetLocalInt(OBJECT_SELF, "DamageOther") - GetLocalInt(OBJECT_SELF, "DamagePC")) + GetLocalInt(OBJECT_SELF, "DamagePC"));
            SendMessageToPC(oPC, IntToString(GetLocalInt(OBJECT_SELF, "DamagePC")));
        }
        else
        {
            SetLocalString(OBJECT_SELF, IntToString(i + 1), GetName(oPC));
            j = j + 1;
        }
    }
}
else
{
    int iDamage = iMaxHit - iCurHit;

    SetLocalInt(OBJECT_SELF, "DamageOther", (iDamage - GetLocalInt(OBJECT_SELF, "DamagePC") - GetLocalInt(OBJECT_SELF, "DamageOther")) + GetLocalInt(OBJECT_SELF, "DamageOther"));
    SendMessageToPC(oPC, IntToString(GetLocalInt(OBJECT_SELF, "DamageOther")));
}
}


. , blush.gif
Aiwan: - . this.gif
-fenix-: - wacko.gif
, , yes.gif

: Lex Dec 7 2005, 21:11

Neverwinter Script Source
//::============================================================================
//:: L&A Script Systems - TEXT COLORS (TS)
//::============================================================================
string sASCII = "#####################################$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~?--? ";

//:: COLOR CONSTANTS
const string TC_DARK_GRAY = "<c>";
const string TC_GRAY = "<c>";
const string TC_DARK_CYAN = "<c >";
const string TC_DARK_MAGENTA = "<c >";
const string TC_DARK_YELLOW = "<c >";
const string TC_DARK_RED = "<c >";
const string TC_DARK_GREEN = "<c >";
const string TC_DARK_BLUE = "<c >";
const string TC_NONE = ""; // Default (no color)
const string TC_END = "</c>"; // (color end TAG)
const string TC_DEFAULT = TXT_COLOR_NONE;
const string TC_WHITE = "<c>"; // White
const string TC_CYAN = "<c >"; // Light Cyan
const string TC_MAGENTA = "<c >"; // Magenta
const string TC_YELLOW = "<c >"; // Yellow
const string TC_RED = "<c >"; // Red
const string TC_GREEN = "<c >"; // Green
const string TC_BLUE = "<c >"; // Blue


// 35 ( , #)
string TC_GetASCIIChar(int nByte);
// 3 :
// Red -
// Green -
// Blue -
// RGB
string TC_ColorTextRGB(string sText, int nRed, int nGreen, int nBlue);
//
string TC_ColorText(string sText, string sColor);

//::============================================================================
string TC_GetASCIIChar(int nByte)
{
return GetSubString(sASCII, nByte, 1);
}
//::============================================================================
string TC_ColorTextRGB(string sText, int nRed, int nGreen, int nBlue)
{
string sResult = "<c" + TC_GetASCIIChar(nRed) + TC_GetASCIIChar(nGreen) + TC_GetASCIIChar(nBlue) + ">" + sText + TC_END;
return sResult;
}
//::============================================================================
string TC_ColorText(string sText, string sColor)
{
string sResult = sColor + sText + TC_END;
return sResult;
}

: justshurik Feb 4 2006, 00:48

, .
NPC , waypoint-. NPC ( , , , . ) . ( )

CODE

location Preobr(vector a, object oArea);
vector Arifm(vector a,vector b,int flag=0);
float ABSVect(vector a);
vector Proizv(vector a, float n);
vector Ort(vector a);
vector Perpend(vector a);
location Loc(float a,float b, object oArea,object oPC,location CastSpell);
void Go(object NPC, location CastSpell,object oPC,object oArea,float a,float b );
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oPC=GetItemActivator();
object oItem =GetItemActivated();
object oArea=GetObjectByTag("arena");
object oNPC1=GetObjectByTag("NPC1");
object oNPC2=GetObjectByTag("NPC2");
object oNPC3=GetObjectByTag("NPC3");
object oNPC4=GetObjectByTag("NPC4");
object oNPC5=GetObjectByTag("NPC5");
object oNPC6=GetObjectByTag("NPC6");
object oNPC7=GetObjectByTag("NPC7");

if("panel"==GetTag(oItem))
{
location lTarget=GetItemActivatedTargetLocation();
AssignCommand(oNPC1,ClearAllActions());
Go(oNPC1,lTarget,oPC,oArea,1.0,1.0);
// a b
AssignCommand(oNPC2,ClearAllActions());
Go(oNPC2,lTarget,oPC,oArea,1.0,-1.0);
// a b
AssignCommand(oNPC3,ClearAllActions());
Go(oNPC3,lTarget,oPC,oArea,5.0,5.0);
// a b
AssignCommand(oNPC4,ClearAllActions());
Go(oNPC4,lTarget,oPC,oArea,5.0,-5.0);
// a b
AssignCommand(oNPC5,ClearAllActions());
Go(oNPC5,lTarget,oPC,oArea,10.0,10.0);
// a b
AssignCommand(oNPC6,ClearAllActions());
Go(oNPC6,lTarget,oPC,oArea,10.0,-10.0);
// a b
AssignCommand(oNPC7,ClearAllActions());
Go(oNPC7,lTarget,oPC,oArea,5.0,0.0);
}; // a b
}


/*******************************************************************************/
//preobrazovanie vector -> location

location Preobr(vector a, object oArea)
{
location Loc1=Location(oArea,a,GetFacing(oArea));
return Loc1;
}

//slogenie i vichitanie vectorov a i b

vector Arifm(vector a,vector b,int flag=0)
{
float ax,ay,az,bx,by,bz;
ax=a.x;
ay=a.y;
az=a.z;
bx=b.x;
by=b.y;
bz=b.z;
if(flag==0)
{
vector Res1=Vector(ax+bx,ay+by,az+bz);
return Res1;
}
else
{
vector Res2=Vector(bx-ax,by-ay,bz-az);
return Res2;
};
}

//ABS vectora
float ABSVect(vector a)
{
float Mod=sqrt((a.x*a.x)+(a.y*a.y)+(a.z*a.z));
return Mod;
}

//umnogenie vectora na skalyar

vector Proizv(vector a, float n)
{
vector Res=Vector(n*a.x,n*a.y,a.z);
return Res;
}

//Ortonormirovka vectora

vector Ort(vector a)
{
float Mod=ABSVect( a);
vector Res=Vector(a.x/Mod,a.y/Mod,a.z/Mod);
return Res;
}

//perpendikulyar k vectoru

vector Perpend(vector a)
{
vector Res=Vector((-1.0)*a.y,a.x,a.z);
return Res;
}

//osnovnaya funkciya

location Loc(float a,float b, object oArea,object oPC,location CastSpell)
{
vector vPC=GetPosition(oPC);

vector vCastSpell=GetPositionFromLocation(CastSpell);

vector vLocal1=Arifm(vPC,vCastSpell,2);

vector vLocal = Ort(vLocal1);

vector Dop=Proizv(vLocal,a);

vector vDop=Arifm(vLocal1,Dop);

vector vGlobalDop=Arifm(vDop,vPC);

vector vPerpendik=Perpend(vDop);

vector vOrt= Ort(vPerpendik);

vector vLocalRes= Proizv(vOrt,b );

vector vGlobalRes=Arifm(vLocalRes,vGlobalDop);

location Result2=Preobr(vGlobalRes,oArea);

return Result2;
}

void Go(object oNPC, location CastSpell,object oPC,object oArea,float a,float b )
{
CastSpell=GetItemActivatedTargetLocation();
location lTarget=Loc(a,b,oArea,oPC,CastSpell);
AssignCommand(oNPC,ActionMoveToLocation(lTarget,TRUE));
}

a b. a NPC , b - NPC .

:
1) " : " "panel"
2) NPC :NPC1 , NPC2 , NPC3 , NPC4 , NPC5 , NPC6 , NPC7

: azathoth Apr 8 2006, 19:05

, . , .

NSS
// name: i_string
// type:
// desc:
// autor: Nightwalker Sorcerer
// date: 4.01.2006
// modified: 11.01.2006

////////////////////////////////////////////////////////////////////////////////
// INFO ////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

/*

Contains:

int FindFirstOf(string sString, string sPattern, int nFrom = 0, int bSymbols = TRUE);
int FindLastSubString(string sString, string sSubString);
int FindSubStringFrom(string sString, string sSubString, int nCount = 0);
int Match(string sString, string sPattern);

*/


////////////////////////////////////////////////////////////////////////////////
// CONSTANTS ///////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

const string ANY_SYMBOL = "?";
const string ANY_SEQUENCE = "*";
const string P_BEGIN = "["; // (1 )
const string P_END = "]"; // (1 )
const string P_OR = "|"; // (1 )
const string SYMBOL_NOT = "!";

////////////////////////////////////////////////////////////////////////////////
// FUNCTION DEFINITIONS ////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

// sString sPattern.
// - sString: ;
// - sPattern: ;
// - nFrom: , ;
// - bSymbols: , ,
//   .
// * ,
//  .
// --> :
//  > FindFirstOf("a", "abc") - 0;
//  > FindFirstOf("word", "ro") - 1;
//  > FindFirstOf("word", " _[](),.-") - ;
//  > FindFirstOf("ww", "w", 1) - 2;
//  > FindFirstOf("string", "some", 1) - .
int FindFirstOf(string sString, string sPattern, int nFrom = 0, int bSymbols = TRUE);

// sSubString sString.
// - sString: ;
// - sSubString: .
// * ,
//  .
int FindLastSubString(string sString, string sSubString);

// sSubstring sString,
// nCount.
// - sString: , ;
// - sSubString: ;
// - nCount: .
// * ,
//  .
int FindSubStringFrom(string sString, string sSubString, int nCount = 0);

// sString sPattern:
// '?' ;
// '*' c ,
//   ( );
// '!' , ,
//   ,
//   ;
// [..|..|..] , .
// - sString: ;
// - sPattern: .
// * TRUE, , FALSE, .
// --> :
//  > "?*" - ;
//  > "itm_*" - , "itm_";
//  > "i_*_gold" - "i_25_gold", "i_pi_gold", "i__gold";
//  > "*a*" - , ;
//  > "[X|N]*" - NWN ;
//  > "[|?[|?]]" - 1-2 ;
//  > "!wrong" - , "wrong".
int Match(string sString, string sPattern);

////////////////////////////////////////////////////////////////////////////////
// IMPLEMENTATION //////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

int FindFirstOf(string sString, string sPattern, int nFrom = 0, int bSymbols = TRUE)
{
int nResult = -1;
int nCounter, nPosition, nLengthPattern = GetStringLength(sPattern);
for (nCounter = 0; nCounter < nLengthPattern; nCounter++)
{
nPosition = FindSubStringFrom(sString, GetSubString(sPattern, nCounter, 1), nFrom);
  if (nResult < 0) nResult = nPosition;
else if ((nPosition >= 0) && (nResult > nPosition)) nResult = nPosition;
}

return nResult;
}

int FindLastSubString(string sString, string sSubString)
{
int nSubStrLength, nResult, nNext;

if ((nSubStrLength = GetStringLength(sSubString)) == 0) return -1;
if ((nNext = (nResult = FindSubString(sString, sSubString))) < 0) return nResult;

while ((nNext = FindSubString((sString = GetStringRight(sString, GetStringLength(sString) - nNext - nSubStrLength)), sSubString)) >= 0)
{
nResult += (nNext + nSubStrLength);
}

return nResult;
}

int FindSubStringFrom(string sString, string sSubString, int nCount = 0)
{
int nResult = FindSubString(GetStringRight(sString, GetStringLength(sString) - nCount) , sSubString);
if (nResult < 0) return nResult;
return (nResult + nCount);
}

int Match(string sString, string sPattern)
{
// DEBUG
//SendMessageToPC(GetFirstPC(), " '"+sString+"' '"+sPattern+"'.");

int nS, nPhB, nPhE;
int nLengthString = GetStringLength(sString);
int nLengthPattern = GetStringLength(sPattern);

if (GetStringLeft(sPattern, 1) == SYMBOL_NOT)
{
return (!Match(sString, GetStringRight(sPattern, nLengthPattern - 1)));
}

if ((nPhE = (nPhB = FindSubString(sPattern, P_BEGIN))) >= 0) //
{
int nNest = 1; //
while ((nPhE >= 0) && (nNest > 0))
{
nPhE = FindFirstOf(sPattern, P_BEGIN + P_END, nPhE + 1);
if (GetSubString(sPattern, nPhE, 1) == P_BEGIN) nNest++;
else nNest--;
}
if (nNest != 0) return FALSE; //

int nPhS, nPhF = nPhB; //
string sSymbol = "";
while ((sSymbol != P_END) && (nPhF >= 0))
{
nPhS = nPhF + 1;
sSymbol = "";
while ((((sSymbol != P_OR) || (nNest > 0)) && ((sSymbol != P_END) || (nNest >= 0))) && (nPhF >= 0))
{
nPhF = FindFirstOf(sPattern, P_BEGIN + P_OR + P_END, nPhF + 1);
sSymbol = GetSubString(sPattern, nPhF, 1);
  if (sSymbol == P_BEGIN) nNest++;
else if (sSymbol == P_END) nNest--;
}
if (Match(sString, GetStringLeft(sPattern, nPhB) + GetSubString(sPattern, nPhS, nPhF - nPhS) + GetStringRight(sPattern, nLengthPattern - nPhE - 1))) return TRUE;
}
return FALSE;
}

if ((nS = FindSubString(sPattern, ANY_SEQUENCE)) > 0) // , ANY_SEQUENCE,
{
if (!Match(GetStringLeft(sString, nS), GetStringLeft(sPattern, nS))) return FALSE;

// "*..."
return Match(GetStringRight(sString, nLengthString - nS), GetStringRight(sPattern, nLengthPattern - nS));
}

if (nS == 0) // ANY_SEQUENCE
{
string sPattern2 = GetStringRight(sPattern, nLengthPattern - 1);
if ((nS = (FindLastSubString(sPattern2, ANY_SEQUENCE) + 1)) > 0) // ANY_SEQUENCE
{
// ANY_SEQUENCE ""
string sPatternAfterSeq = GetStringRight(sPattern, GetStringLength(sPattern) - nS - 1);
int nLengthAfterSeq = GetStringLength(sPatternAfterSeq);
if (!Match(GetStringRight(sString, nLengthAfterSeq), sPatternAfterSeq)) return FALSE;

// "*...*"
nLengthString = GetStringLength(sString = GetStringLeft(sString, nLengthString - nLengthAfterSeq));
nLengthPattern = GetStringLength(sPattern = GetStringLeft(sPattern, nS + 1));

// DEBUG:
//SendMessageToPC(GetFirstPC(), " '"+sString+"' '"+sPattern+"'");
int nCounter1, nCounter2;
for (nCounter1 = 1; (nCounter1 < nLengthString); nCounter1++)
{
for (nCounter2 = 1; (nCounter2 < nLengthPattern); nCounter2++)
{
if (Match(GetStringLeft(sString, nCounter1), GetStringLeft(sPattern, nCounter2)))
if (Match(GetStringRight(sString, nLengthString - nCounter1), GetStringRight(sPattern, nLengthPattern - nCounter2)))
return TRUE;
}
}
return FALSE;
}

// ANY_SEQUENCE ;
return Match(GetStringRight(sString, GetStringLength(sPattern2)), sPattern2);
}

//
if (nLengthString != nLengthPattern) return FALSE;

if ((nS = FindSubString(sPattern, ANY_SYMBOL)) >= 0) // ANY_SYMBOL
{
return Match(GetStringLeft(sString, nS), GetStringLeft(sPattern, nS))
&&   Match(GetStringRight(sString, nLengthString - nS - 1), GetStringRight(sPattern, nLengthPattern - nS - 1));
}

return (sString == sPattern);
}

//void main(){}

, . : CreateItemList HasItemList RemoveItemList, .
NSS
// name: i_inv
// type:
// desc: .
// autor: Nightwalker Sorcerer
// date: 11.01.2005
// modified: 13.01.2005

////////////////////////////////////////////////////////////////////////////////
// INFO ////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

/*

Contains:

void CreateItemList(string sList, object oTarget = OBJECT_SELF);
int GetNumItems(object oTarget = OBJECT_SELF, string sTag = "*", int bCreatureSlots = FALSE);
int GetNumItemsInInventory(object oInventory = OBJECT_SELF, string sTag = "*");
int GetNumItemsInSlot(object oTarget, int nSlot, string sTag = "*");
int HasItemList(object oTarget, string sList, int bCreatureSlots = FALSE);
void RemoveItemList(object oTarget, string sList, int bCreatureSlots = FALSE);
int RemoveItemsFromInventory(object oInventory = OBJECT_SELF, string sTag = "*", int nNum = -1);
int RemoveItemsFromSlot(object oTarget, int nSlot, string sTag = "*", int nNum = -1);
int RemoveItemsFromSlots(object oTarget = OBJECT_SELF, string sTag = "*", int nNum = -1, int bCreatureSlots = FALSE)

*/


////////////////////////////////////////////////////////////////////////////////
// INCLUDES ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

#include "i_string"

////////////////////////////////////////////////////////////////////////////////
// CONSTANTS ///////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

const string SYMBOL_AND = "&";
const string SYMBOL_EQU = "=";

////////////////////////////////////////////////////////////////////////////////
// FUNCTION DEFINITIONS ////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

// oTarget
// - sList: "1=-1&2=-2&3=-3",
//  "=", 1;
// - oTarget: ?
// --> :
//  > CreateItemList("single_item");
//  > CreateItemList("first_item&second_item&one_arrow=99", oTreasure);
// ? : '&' , '&&'.
void CreateItemList(string sList, object oTarget = OBJECT_SELF);

// sTag oTarget (
// )
// - oInventory: , ;
// - sTag: ;
// - bCreatureSlots: ?
// * .
int GetNumItems(object oTarget = OBJECT_SELF, string sTag = "*", int bCreatureSlots = FALSE);

// sTag oInventory,
// .
// - oInventory:
// - sTag:
// * ,
// --> :
//  > GetNumItemsInInventory(oChest, "itm_sword*") - ,
//   "itm_sword" oChest;
//  > GetNumItemsInInventory(oPC, "eda") - "eda" oPC.
int GetNumItemsInInventory(object oInventory = OBJECT_SELF, string sTag = "*");

// sTag nSlot
// oTarget.
// - oTarget: , ;
// - nSlot: ;
// - sTag: .
// * .
int GetNumItemsInSlot(object oTarget, int nSlot, string sTag = "*");

// sTag
// oTarget.
// - oTarget: , ;
// - sTag: ;
// - bCreatureSlots: ?
// * .
int GetNumItemsInSlots(object oTarget = OBJECT_SELF, string sTag = "*", int bCreatureSlots = FALSE);

// , oTarget c sList.
// - sList: "1=-1&2=-2&3=-3",
//  "=", 1;
// - oTarget: ;
// - bCreatureSlots: ?
// * TRUE, , FALSE.
// --> :
//  > asItemList(oPC, "quest&gem[1|2]=6") - ,
//   c "quest" gem1 gem2
// ? : '&' , '&&'.
int HasItemList(string sList, object oTarget = OBJECT_SELF, int bCreatureSlots = FALSE);

// Target sList.
// - sList: "1=-1&2=-2&3=-3",
//  "=", 1;
// - oTarget: ;
// - bCreatureSlots: ?
// --> :
//  > RemoveItemList(oPC, "fragile=-1&extra") -
//   "fragile" "extra".
// ? : '&' , '&&'.
void RemoveItemList(string sList, object oTarget = OBJECT_SELF, int bCreatureSlots = FALSE);

// sTag .
// - oTarget: ;
// - sTag: ;
// - nNum: , ,
// ;
// - bCreatureSlots: ?
// * , .
// --> :
//  > RemoveItems(oTarget) - ;
//  > RemoveItems(oPC, "flower", 2) - oPC "flower".
int RemoveItems(object oTarget, string sTag = "*", int nNum = -1, int bCreatureSlots = FALSE);

// ,
// - oInventory:
// - sTag:
// - nNum: , -1 ,
// 
// * , , . 0,
//  , , ,
//  c . -1, .
//  = nNum - RemoveItemsFromInventory(,, nNum)
// --> :
//  > int nNoFood = RemoveItemsFromInventory(oPC, "itm_food", 1) - 1 ,
//   nNoFood = 1, oPC ;
//  > RemoveItemsFromInventory(oPC, "x*") - oPC .
int RemoveItemsFromInventory(object oInventory = OBJECT_SELF, string sTag = "*", int nNum = -1);

// nNum nSlot oTarget,
// sTag.
// - oTarget: , ;
// - nSlot: , ;
// - sTag: ;
// - nNum: , ,
//  .
// * , ,
//  , .
int RemoveItemsFromSlot(object oTarget, int nSlot, string sTag = "*", int nNum = -1);

// nNum oTarget .
// - oTarget: ;
// - sTag: ;
// - nNum: , ,
//  ;
// - bCreatureSlots: .
// * , ,
//  , .
int RemoveItemsFromSlots(object oTarget = OBJECT_SELF, string sTag = "*", int nNum = -1, int bCreatureSlots = FALSE);

////////////////////////////////////////////////////////////////////////////////
// IMPLEMENTATION //////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

void CreateItemList(string sList, object oTarget = OBJECT_SELF)
{
int nDiv, nNum;
string sResRef;
while (sList != "")
{
if ((nDiv = FindSubString(sList, SYMBOL_AND)) < 0)
{
nDiv = GetStringLength(sList);
}
sResRef = GetStringLeft(sList, nDiv);
sList = GetStringRight(sList, GetStringLength(sList) - nDiv - 1);
nNum = 1;
if ((nDiv = FindSubString(sResRef, SYMBOL_EQU)) >= 0)
{
nNum = StringToInt(GetStringRight(sResRef, GetStringLength(sResRef) - nDiv - 1));
sResRef = GetStringLeft(sResRef, nDiv);
}

for ( ; nNum > 0; nNum--) CreateItemOnObject(sResRef, oTarget); //
}
}

int GetNumItems(object oTarget = OBJECT_SELF, string sTag = "*", int bCreatureSlots = FALSE)
{
return GetNumItemsInInventory(oTarget, sTag) + GetNumItemsInSlots(oTarget, sTag, bCreatureSlots);
}

int GetNumItemsInInventory(object oInventory = OBJECT_SELF, string sTag = "*")
{
int nNum = 0;
object oItem = GetFirstItemInInventory(oInventory);
while (GetIsObjectValid(oItem))
{
if (Match(GetTag(oItem), sTag))
{
nNum += GetItemStackSize(oItem);
}

oItem = GetNextItemInInventory(oInventory);
}

return nNum;
}

int GetNumItemsInSlot(object oTarget, int nSlot, string sTag = "*")
{
object oItem = GetItemInSlot(nSlot, oTarget);
if (Match(GetTag(oItem), sTag)) return GetItemStackSize(oItem);
return 0;
}

int GetNumItemsInSlots(object oTarget = OBJECT_SELF, string sTag = "*", int bCreatureSlots = FALSE)
{
int nNum = 0;
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_ARMS, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_ARROWS, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_BELT, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_BOLTS,   sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_BOOTS,   sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_BULLETS,  sTag);
//nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CARMOUR,  sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CHEST,   sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CLOAK,   sTag);
//nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CWEAPON_B, sTag);
//nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CWEAPON_L, sTag);
//nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CWEAPON_R, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_HEAD, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_LEFTHAND, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_LEFTRING, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_NECK, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_RIGHTHAND, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_RIGHTRING, sTag);
if (bCreatureSlots)
{
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CARMOUR,  sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CWEAPON_B, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CWEAPON_L, sTag);
nNum += GetNumItemsInSlot(oTarget, INVENTORY_SLOT_CWEAPON_R, sTag);
}

return nNum;
}

int HasItemList(string sList, object oTarget = OBJECT_SELF, int bCreatureSlots = FALSE)
{
int nDiv, nNum;
string sTag;
while (sList != "")
{
if ((nDiv = FindSubString(sList, SYMBOL_AND)) < 0)
{
nDiv = GetStringLength(sList);
}
sTag = GetStringLeft(sList, nDiv);
sList = GetStringRight(sList, GetStringLength(sList) - nDiv - 1);
if ((nDiv = FindSubString(sTag, SYMBOL_EQU)) >= 0)
{
nNum = StringToInt(GetStringRight(sTag, GetStringLength(sTag) - nDiv - 1));
sTag = GetStringLeft(sTag, nDiv);
}
else
{
nNum = 1;
}

if (sTag != "")
if (GetNumItems(oTarget, sTag, bCreatureSlots) < nNum) return FALSE;
}
return TRUE;
}

void RemoveItemList(string sList, object oTarget = OBJECT_SELF, int bCreatureSlots = FALSE)
{
int nDiv, nNum;
string sTag;
while (sList != "")
{
if ((nDiv = FindSubString(sList, SYMBOL_AND)) < 0)
{
nDiv = GetStringLength(sList);
}
sTag = GetStringLeft(sList, nDiv);
sList = GetStringRight(sList, GetStringLength(sList) - nDiv - 1);
if ((nDiv = FindSubString(sTag, SYMBOL_EQU)) >= 0)
{
nNum = StringToInt(GetStringRight(sTag, GetStringLength(sTag) - nDiv - 1));
sTag = GetStringLeft(sTag, nDiv);
}
else
{
nNum = 1;
}

RemoveItems(oTarget, sTag, nNum, bCreatureSlots);
}
}

int RemoveItems(object oTarget, string sTag = "*", int nNum = -1, int bCreatureSlots = FALSE)
{
nNum = RemoveItemsFromInventory(oTarget, sTag, nNum);
return RemoveItemsFromSlots(oTarget, sTag, nNum, bCreatureSlots);
}

int RemoveItemsFromInventory(object oInventory = OBJECT_SELF, string sTag = "*", int nNum = -1)
{
int nStack;
object oItem = GetFirstItemInInventory(oInventory);
while (GetIsObjectValid(oItem) && (nNum != 0))
{
if (Match(GetTag(oItem), sTag))
{
  if (nNum < 0) DestroyObject(oItem);
else if ((nStack = GetItemStackSize(oItem)) > nNum)
{
SetItemStackSize(oItem, nStack - nNum);
return 0;
}
else
{
DestroyObject(oItem);
nNum -= nStack;
}
}

oItem = GetNextItemInInventory(oInventory);
}

return nNum;
}

int RemoveItemsFromSlot(object oTarget, int nSlot, string sTag = "*", int nNum = -1)
{
if (nNum == 0) return nNum;

object oItem = GetItemInSlot(nSlot, oTarget);
if (GetIsObjectValid(oItem))
if (Match(GetTag(oItem), sTag))
{
int nStack;

  if (nNum < 0) DestroyObject(oItem);
else if ((nStack = GetItemStackSize(oItem)) > nNum)
{
SetItemStackSize(oItem, nStack - nNum);
return 0;
}
else
{
DestroyObject(oItem);
nNum -= nStack;
}

}
return nNum;
}

int RemoveItemsFromSlots(object oTarget = OBJECT_SELF, string sTag = "*", int nNum = -1, int bCreatureSlots = FALSE)
{
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_ARMS, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_ARROWS, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_BELT, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_BOLTS,   sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_BOOTS,   sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_BULLETS,  sTag, nNum);
//nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CARMOUR,  sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CHEST,   sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CLOAK,   sTag, nNum);
//nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CWEAPON_B, sTag, nNum);
//nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CWEAPON_L, sTag, nNum);
//nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CWEAPON_R, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_HEAD, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_LEFTHAND, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_LEFTRING, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_NECK, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_RIGHTHAND, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_RIGHTRING, sTag, nNum);
if (bCreatureSlots)
{
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CARMOUR,  sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CWEAPON_B, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CWEAPON_L, sTag, nNum);
nNum = RemoveItemsFromSlot(oTarget, INVENTORY_SLOT_CWEAPON_R, sTag, nNum);
}
return nNum;
}

//void main(){}


( ):
- ( 3) ( "quest_item")
NSS
#include "i_inv"

int StartingConditional()
{
    object oPC = GetPCSpeaker();
    int n = GetNumItems(oPC, "quest_item");
    return (n >= 3);
}

- - ( 3 "quest_item")
NSS
#include "i_inv"

void main()
{
    object oPC = GetPCSpeaker();
    RemoveItems(oPC, "quest_item", 3);
}

: Aiwan Apr 23 2006, 16:57

, , .


NSS
//
// oMaster=OBJECT_SELF oNewMaster
// iDel = TRUE - , FALSE -
// iUnequip = TRUE - ,
void CopyInventory(object oNewMaster, object oMaster=OBJECT_SELF, int iDel=TRUE, int iUnequip=FALSE);

void CopyInventory(object oNewMaster, object oMaster=OBJECT_SELF, int iDel=TRUE, int iUnequip=FALSE)
{
      if(iUnequip==TRUE)
      {
        int i=0;
        while(i<14)
        {
          if(GetItemInSlot(i, oMaster)!= OBJECT_INVALID)
          CopyItem(GetItemInSlot(i, oMaster), oNewMaster, TRUE);
          if(iDel==TRUE) DestroyObject(GetItemInSlot(i, oMaster));
          i++;
        }
      }
      object oItem = GetFirstItemInInventory(oMaster);
      while(GetIsObjectValid(oItem))
      {
        if(GetBaseItemType(oItem) == BASE_ITEM_LARGEBOX)
        {
          CreateItemOnObject(GetResRef(oItem), oNewMaster, 1);
          if(iDel==TRUE) DestroyObject(oItem, 0.5);
        }
        else
            {
              CopyItem(oItem, oNewMaster, TRUE);
              if(iDel==TRUE) DestroyObject(oItem);
            }
          oItem = GetNextItemInInventory(oMaster);
      }
}


. 25 , 3 .
NSS
//
int GetItemStackNumber(string sTagItem, object oTarget=OBJECT_SELF);

// iNum
void RemoveItemStackNumber(string sTagItem, int iNum = 1, object oTarget=OBJECT_SELF);

//------------------------------------------------------------------------------
int GetItemStackNumber(string sTagItem, object oTarget=OBJECT_SELF)
{
  object oItem = GetFirstItemInInventory(oTarget);
  int iNum = 0;
  while (GetIsObjectValid(oItem))
  {
      if (GetTag(oItem) == sTagItem)
      {
        iNum = iNum+GetItemStackSize(oItem);
      }
        oItem = GetNextItemInInventory(oTarget);
    }
    return iNum;
}
//------------------------------------------------------------------------------
void RemoveItemStackNumber(string sTagItem, int iNum = 1, object oTarget=OBJECT_SELF)
{
  object oItem = GetFirstItemInInventory(oTarget);
  while (GetIsObjectValid(oItem) && (iNum != 0))
  {
      if (GetTag(oItem) == sTagItem)
        {
          int i = GetItemStackSize(oItem);
          if (i > iNum)
          {
            SetItemStackSize(oItem, GetItemStackSize(oItem)-iNum);
            iNum = 0;
          }
          else
              {
                DestroyObject(oItem);
                iNum = iNum-i;
              }
        }
        oItem = GetNextItemInInventory(oTarget);
    }
}


.
NSS
//
//
int GetCreatureBestClass(object oCr=OBJECT_SELF);

int GetCreatureBestClass(object oCr)
{
    int class1 = GetClassByPosition(1, oCr);
    int class2 = GetClassByPosition(2, oCr);
    int class3 = GetClassByPosition(3, oCr);
    int classlev1, classlev2, classlev3;
    classlev1 = GetLevelByClass(class1, oCr);
    if (class2 != CLASS_TYPE_INVALID)
        classlev2 = GetLevelByClass(class2, oCr);
    if (class3 != CLASS_TYPE_INVALID)
        classlev3 = GetLevelByClass(class3, oCr);
    int BestClass = class1;
    if (classlev1 < classlev2)
        BestClass = class2;
    if (classlev2 < classlev3)
        BestClass = class3;
    return BestClass;
}

: kreon Apr 24 2006, 06:49

"" DM'
, DM' .

P.S. - ,
onClientEnter

NSS
int nMaxPlayers = 30; // .
void main() {
object oPC = GetEnteringObject();
object oMod = GetModule();
int nCurrPC = GetLocalInt(oMod, "CurrPC");
if(nCurrPC >= nMaxPlayers && !GetIsDM(oPC)) {
  BootPC(oPC);
  return;
}
SetLocalInt(oMod, "CurrPC", nCurrPC+1);
// oncliententer
// ...

OnClientExit
NSS
void main() {
object oMod = GetModule();
SetLocalInt(oMod, "CurrPC", GetLocalInt(oMod, "CurrPC")-1);
// onclientexit
// ...

: Zirrex Apr 24 2006, 13:02

-.

. . , -, , , .

, , . "" , .. , . , - . . , 30. 35 , 30- , . .. , . .

NSS
void main()
{
    object oMod = GetModule();

//--------------------------------------------------//
// ,   //
//       //
// 'OnModuleLoad'.                        //
    int DMRESERVE = 30; // - 30
    SetLocalInt(oMod, "DMRESERVE", DMRESERVE);
//--------------------------------------------------//

    object oClient = GetEnteringObject();

    if (GetIsDM(oClient) == FALSE)
    {
        int nReserve = GetLocalInt(oMod, "DMRESERVE");

        if (nReserve == TRUE)
        {
            int nPlayer;

            object oPlayer = GetFirstPC();

            while (GetIsObjectValid(oPlayer))
            {
                nPlayer++;
                oPlayer = GetNextPC();
            }

            if (nPlayer > nReserve)
            {
                BootPC(oClient);
                return;
            }
        }
    }
}


.. kreon, , .

: Fluyka Apr 29 2006, 14:22

, ... . , .... .smile.gif)

NSS
////////////////////////////////////////////////////////////////////////////////
///// 3 .///
////////////////////////////////////////////////////////////////////////////////
void Examen(object oPC = OBJECT_SELF)
{
if(!GetLocalInt(oPC,"Rest"))
  {
  ForceRest(oPC);//
  ActionMoveToLocation(GetLocation(oPC));//
  FloatingTextStringOnCreature( " .",oPC);

  //
  if(GetIsObjectValid(GetLocalObject(oPC,"GodLay")))
    {
    DestroyObject(GetLocalObject(oPC,"GodLay"));
    DeleteLocalObject(oPC,"GodLay");
    }

  DeleteLocalLocation(oPC, "RestLocation");
  return;
  }
if(GetLocation(oPC) != GetLocalLocation(oPC, "RestLocation"))
  {
  ActionMoveToLocation(GetLocation(oPC));
  FloatingTextStringOnCreature(" .",oPC);

  //
  if(GetIsObjectValid(GetLocalObject(oPC,"GodLay")))
    {
    DestroyObject(GetLocalObject(oPC,"GodLay"));
    DeleteLocalObject(oPC,"GodLay");
    }

  DeleteLocalInt(oPC,"Rest");
  DeleteLocalLocation(oPC, "RestLocation");
  return;
  }
else
  {
  AssignCommand(oPC, DelayCommand(3.0f, Examen(oPC)));
  AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE,1.0,3.0));
  }
}

////////////////////////////////////////////////////////////////////////////////
/// ///////////////
////////////////////////////////////////////////////////////////////////////////
void BeginGodMagic(object oPC =OBJECT_SELF)
{
object oLay;// , , . smile.gif

//
if(GetAlignmentGoodEvil(oPC)==ALIGNMENT_EVIL)
{oLay = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solred",GetLocation(oPC));}
else if (GetAlignmentGoodEvil(oPC)==ALIGNMENT_NEUTRAL)
{oLay = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solblue",GetLocation(oPC));}
else oLay = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solwhite",GetLocation(oPC));

//
SetLocalLocation(oPC, "RestLocation", GetLocation(oPC));
SetLocalInt(oPC,"Rest",TRUE);
SetLocalObject(oPC,"GodLay",oLay);

AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE,1.0,3.0));
AssignCommand(oPC, DelayCommand(3.0, Examen()));

DelayCommand(1.0,FloatingTextStringOnCreature(" .",oPC));
DelayCommand(30.0,DeleteLocalInt(oPC,"Rest"));
}

////////////////////////////////////////////////////////////////////////////////
// /////////////////////////
// , ,- .////////////////////
// , ./////////////////////////////
//.//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

/*void ExsamenGod(object oPC = OBJECT_SELF)
{
object oGodLatander,oGodMysrta;
int nTime = GetTimeHour();

oGodLatander = GetItemPossessedBy(oPC,"i_latander_sign");
oGodMysrta = GetItemPossessedBy(oPC,"i_mystra_sign");

// Latander
if(GetIsObjectValid(oGodLatander))
{
if((nTime>=6)&&(nTime<13)){BeginGodMagic(oPC);return;}
else return;
}
//Mystra
else if(GetIsObjectValid(oGodMysrta))
{
if((nTime>=23)&&(nTime<4)){BeginGodMagic(oPC);return;}
else return;
}
else{FloatingTextStringOnCreature(" .",oPC);}
}*/


////////////////////////////////////////////////////////////////////////////////
/// /////////////////
////////////////////////////////////////////////////////////////////////////////
void BeginArcaneMagic(object oPC =OBJECT_SELF)
{
SetLocalLocation(oPC, "RestLocation", GetLocation(oPC));
SetLocalInt(oPC,"Rest",TRUE);

AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE,1.0,3.0));
DelayCommand(3.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_READ,1.0,10.0)));
AssignCommand(oPC, DelayCommand(3.0, Examen()));
DelayCommand(1.0,FloatingTextStringOnCreature(" .",oPC));
DelayCommand(30.0,DeleteLocalInt(oPC,"Rest"));
}

////////////////////////////////////////////////////////////////////////////////
///// . ?  //////////////////////////
////////////////////////////////////////////////////////////////////////////////
void ExamenCastClass(object oPC = OBJECT_SELF)
{

int iu = 1,iClass;
while(iu <=3)
  {
    iClass=GetClassByPosition(iu,oPC);
    if(iClass == CLASS_TYPE_CLERIC){BeginGodMagic(oPC);return;}
    else if(iClass == CLASS_TYPE_DRUID){BeginGodMagic(oPC);return;}
    else if(iClass == CLASS_TYPE_PALADIN){BeginGodMagic(oPC);return;}
    else if(iClass == CLASS_TYPE_RANGER){BeginGodMagic(oPC);return;}
    else if(iClass ==  CLASS_TYPE_WIZARD){BeginArcaneMagic(oPC);return;}
    else if(iClass == CLASS_TYPE_SORCERER){BeginArcaneMagic(oPC);return;}
    else if(iClass == CLASS_TYPE_BARD){BeginArcaneMagic(oPC);return;}
    iu++ ;
  }
}

////////////////////////////////////////////////////////////////////////////////
/// /////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void SpellDelete(object oPC = OBJECT_SELF)
{

int nSpell, nKSpell;
for (nSpell = 0; nSpell < 1000; nSpell++)
{
        nKSpell = GetHasSpell(nSpell, oPC);
        if (nKSpell)
        {
          while (nKSpell > 0)
          {
            DecrementRemainingSpellUses(oPC, nSpell);
            nKSpell--;
          }
        }
}
}

////////////////////////////////////////////////////////////////////////////////
//////////////////    ///////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oPC = GetLastPCRested();
object oItem,oItem1;
switch(GetLastRestEventType())
    {
      case REST_EVENTTYPE_REST_STARTED:
      {
      // , ..
      break;
      }
      case REST_EVENTTYPE_REST_CANCELLED:
      {
      break;
      }
      case REST_EVENTTYPE_REST_FINISHED:
      {

      SpellDelete(oPC);
      DelayCommand(1.5,ExamenCastClass(oPC));
      break;
      }
    }
}

: kreon May 10 2006, 22:15

, ... ( )
jail_include.nss

NSS
int WP_COUNT = 5; // -
int PC_PER_WP = 1; // 1
string WP_SUFFIX = "_jail_wp"; //

jail_on_enter.nss
NSS
#include "jail_include"
void main() {
object oPC = GetEnteringObject();
if(!GetIsPC(oPC) || GetIsDM(oPC)) return;
int i, count;
string sWTag;
object oWP;
for(i=0;i<WP_COUNT;i++) {
oWP = GetObjectByTag("wp_"+IntToString(i)+WP_SUFFIX);
count = GetLocalInt(oWP, "pc_count");
if(count < PC_PER_WP) {
  SetLocalInt(oWP, "pc_count", count+1);
  SetLocalObject(oPC, "wp"+WP_SUFFIX, oWP);
  AssignCommand(oPC, ActionJumpToObject(oWP));
  return;
}
}
oWP = GetObjectByTag("wp_all"+WP_SUFFIX);
AssignCommand(oPC, ActionJumpToObject(oWP));
}

jail_on_exit.nss
NSS
#include "jail_include"
void main() {
object oPC = GetExitingObject();
if(!GetIsPC(oPC) || GetIsDM(oPC)) return;
object oWP = GetLocalObject(oPC, "wp"+WP_SUFFIX);
int count = GetLocalInt(oWP, "pc_count");
SetLocalInt(oWP, "pc_count", count-1);
DeleteLocalObject(oPC, "wp"+WP_SUFFIX);
}

. "wp_"+id+WP_SUFFIX, 1 "wp_all"+WP_SUFFIX
smile.gif

: azathoth Jun 11 2006, 02:50

, . , ( ), . +. , "Weapon Finesse" ( , ). ( ), -- .
, - , .
BASE_ITEM_*, .

NSS
int GetWeaponBestBaseType(object oFor)
{
    //if (GetHasFeat(FEAT_WEAPON_FOCUS_DART, oFor)) return BASE_ITEM_DART;
    //if (GetHasFeat(FEAT_WEAPON_FOCUS_SHURIKEN, oFor)) return = BASE_ITEM_SHURIKEN;
    //if (GetHasFeat(FEAT_WEAPON_FOCUS_THROWING_AXE, oFor)) return THROWINGAXE;

    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_EXOTIC, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_BASTARD_SWORD, oFor)) return BASE_ITEM_BASTARDSWORD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_KATANA, oFor)) return BASE_ITEM_KATANA;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DWAXE, oFor)) return  BASE_ITEM_DWARVENWARAXE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_KUKRI, oFor)) return BASE_ITEM_KUKRI;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SCYTHE, oFor)) return BASE_ITEM_SCYTHE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_TWO_BLADED_SWORD, oFor)) return BASE_ITEM_TWOBLADEDSWORD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DIRE_MACE, oFor)) return BASE_ITEM_DIREMACE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DOUBLE_AXE, oFor)) return BASE_ITEM_DOUBLEAXE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_KAMA, oFor)) return BASE_ITEM_KAMA;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_WHIP, oFor)) return BASE_ITEM_WHIP;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_MARTIAL, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_BATTLE_AXE, oFor)) return BASE_ITEM_BATTLEAXE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_GREAT_AXE, oFor)) return BASE_ITEM_GREATAXE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_GREAT_SWORD, oFor)) return BASE_ITEM_GREATSWORD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HALBERD, oFor)) return BASE_ITEM_HALBERD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HAND_AXE, oFor)) return BASE_ITEM_HANDAXE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_FLAIL, oFor)) return BASE_ITEM_HEAVYFLAIL;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_FLAIL, oFor)) return BASE_ITEM_LIGHTFLAIL;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_HAMMER, oFor)) return BASE_ITEM_LIGHTHAMMER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LONG_SWORD, oFor)) return BASE_ITEM_LONGSWORD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LONGBOW, oFor)) return BASE_ITEM_LONGBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_RAPIER, oFor)) return BASE_ITEM_RAPIER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SCIMITAR, oFor)) return BASE_ITEM_SCIMITAR;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SHORT_SWORD, oFor)) return BASE_ITEM_SHORTSWORD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW, oFor)) return BASE_ITEM_SHORTBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_WAR_HAMMER, oFor)) return BASE_ITEM_WARHAMMER;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_ELF, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LONG_SWORD, oFor)) return BASE_ITEM_LONGSWORD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LONGBOW, oFor)) return BASE_ITEM_LONGBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_RAPIER, oFor)) return BASE_ITEM_RAPIER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW, oFor)) return BASE_ITEM_SHORTBOW;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_ROGUE, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_CLUB, oFor)) return BASE_ITEM_CLUB;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DAGGER, oFor)) return BASE_ITEM_DAGGER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HAND_AXE, oFor)) return BASE_ITEM_HANDAXE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW, oFor)) return BASE_ITEM_HEAVYCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW, oFor)) return BASE_ITEM_LIGHTCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_MACE, oFor)) return BASE_ITEM_LIGHTMACE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_MORNING_STAR, oFor)) return BASE_ITEM_MORNINGSTAR;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_RAPIER, oFor)) return BASE_ITEM_RAPIER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SHORT_SWORD, oFor)) return BASE_ITEM_SHORTSWORD;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW, oFor)) return BASE_ITEM_SHORTBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_STAFF, oFor)) return BASE_ITEM_QUARTERSTAFF;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_SIMPLE, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_CLUB, oFor)) return BASE_ITEM_CLUB;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DAGGER, oFor)) return BASE_ITEM_DAGGER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW, oFor)) return BASE_ITEM_HEAVYCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW, oFor)) return BASE_ITEM_LIGHTCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_MACE, oFor)) return BASE_ITEM_LIGHTMACE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_MORNING_STAR, oFor)) return BASE_ITEM_MORNINGSTAR;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SICKLE, oFor)) return BASE_ITEM_SICKLE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SLING, oFor)) return BASE_ITEM_SLING;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SPEAR, oFor)) return BASE_ITEM_SHORTSPEAR;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_STAFF, oFor)) return BASE_ITEM_QUARTERSTAFF;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_DRUID, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_CLUB, oFor)) return BASE_ITEM_CLUB;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DAGGER, oFor)) return BASE_ITEM_DAGGER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SCIMITAR, oFor)) return BASE_ITEM_SCIMITAR;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SICKLE, oFor)) return BASE_ITEM_SICKLE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SLING, oFor)) return BASE_ITEM_SLING;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SPEAR, oFor)) return BASE_ITEM_SHORTSPEAR;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_STAFF, oFor)) return BASE_ITEM_QUARTERSTAFF;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_MONK, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_KAMA, oFor)) return BASE_ITEM_KAMA;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_CLUB, oFor)) return BASE_ITEM_CLUB;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DAGGER, oFor)) return BASE_ITEM_DAGGER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HAND_AXE, oFor)) return BASE_ITEM_HANDAXE;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW, oFor)) return BASE_ITEM_HEAVYCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW, oFor)) return BASE_ITEM_LIGHTCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_SLING, oFor)) return BASE_ITEM_SLING;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_STAFF, oFor)) return BASE_ITEM_QUARTERSTAFF;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_WIZARD, oFor))
    {
        if (GetHasFeat(FEAT_WEAPON_FOCUS_CLUB, oFor)) return BASE_ITEM_CLUB;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_DAGGER, oFor)) return BASE_ITEM_DAGGER;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW, oFor)) return BASE_ITEM_HEAVYCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW, oFor)) return BASE_ITEM_LIGHTCROSSBOW;
        if (GetHasFeat(FEAT_WEAPON_FOCUS_STAFF, oFor)) return BASE_ITEM_QUARTERSTAFF;
    }

    int nSize = GetCreatureSize(oFor);

    if (GetHasFeat(FEAT_POINT_BLANK_SHOT, oFor))
    {
        // TODO: range weapons
    }

    if (GetHasFeat(FEAT_WEAPON_FINESSE, oFor))
    {
        // TODO: fine weapons
    }

    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_MONK, oFor))
    {
        return BASE_ITEM_KAMA;
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_EXOTIC, oFor))
    {
        // double weapons if has two-weapon fighting feats
        if (GetHasFeat(FEAT_AMBIDEXTERITY, oFor) && GetHasFeat(FEAT_IMPROVED_TWO_WEAPON_FIGHTING, oFor) && (nSize >= CREATURE_SIZE_MEDIUM))
        {
            switch (Random(3))
            {
                case 0: return BASE_ITEM_DIREMACE;
                case 1: return BASE_ITEM_DOUBLEAXE;
                case 2: return BASE_ITEM_TWOBLADEDSWORD;
            }
        }
        // two-handed weapon if can't use shield
        if (!GetHasFeat(FEAT_SHIELD_PROFICIENCY, oFor))
        {
            switch(nSize)
            {
            case CREATURE_SIZE_HUGE:
            case CREATURE_SIZE_LARGE:
            case CREATURE_SIZE_MEDIUM: return BASE_ITEM_SCYTHE;
            case CREATURE_SIZE_SMALL: switch (Random(3))
                {
                case 0: return BASE_ITEM_BASTARDSWORD;
                case 1: return BASE_ITEM_KATANA;
                case 2: return BASE_ITEM_DWARVENWARAXE;
                }
            case CREATURE_SIZE_TINY: switch (Random(3))
                {
                case 0: return BASE_ITEM_KAMA;
                case 1: return BASE_ITEM_WHIP;
                case 2: return BASE_ITEM_KUKRI;
                }
            }
        }
        // one-handed weapon
        switch (nSize)
        {
        case CREATURE_SIZE_HUGE:
        case CREATURE_SIZE_LARGE: return BASE_ITEM_SCYTHE;
        case CREATURE_SIZE_MEDIUM: switch (Random(3))
            {
            case 0: return BASE_ITEM_BASTARDSWORD;
            case 1: return BASE_ITEM_KATANA;
            case 2: return BASE_ITEM_DWARVENWARAXE;
            }
        case CREATURE_SIZE_SMALL: switch (Random(3))
            {
            case 0: return BASE_ITEM_KAMA;
            case 1: return BASE_ITEM_KUKRI;
            case 2: return BASE_ITEM_WHIP;
            }
        case CREATURE_SIZE_TINY:
        }
    }
    if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_MARTIAL, oFor))
&nb