Neverwinter Nights > Script Request
legit pvp server script
Pazuul:
I started a server for my clan on godspire.
Now I've been working with it for a week or so I really start liking it and I whould like to improve my server.
Could somwone post a script here or make a link or someting so I can put the same rules on my server as on godspire?
Since my clan is on godspire having the same rules would be usefull so I can train with my clan on my server.
So the program has to check evryting somwone could use to cheat ...
I hope somwone here knows the rules of godspire and can make me a script that has exactly the same rules. Mayby talon could just copy his script?
I ask this cuz I can't do any scripting myself.
I looked on the nwvault but its too hard to adjust those scripts and they do too much or too few...
Ps: I also need the duell manager script :P. I can't download the one 420 posted...
Tea-cup:
Eh, .... well, this kind of post get me depressed:
--- Quote ---Could somwone post a script here or make a link or someting so I can put the same rules on my server as on godspire?
--- End quote ---
A script.. It won't fit in 1 script..
--- Quote ---I hope somwone here knows the rules of godspire and can make me a script that has exactly the same rules. Mayby talon could just copy his script?
--- End quote ---
Copy and give away his filter, he, I believe hamster can fly too :glare:
--- Quote ---I ask this cuz I can't do any scripting myself.
--- End quote ---
Don't start whit maintaining a server whit heavy scripts then ...
Time to learn scripting I guess.
--- Quote ---I looked on the nwvault but its too hard to adjust those scripts and they do too much or too few...
--- End quote ---
Will take like 1000 or more lines of scripting to get gs like rules/gameplay whitout bugs.
--- Quote ---I also need the duell manager script :P. I can't download the one 420 posted...
--- End quote ---
Well, I have that somewhere.
--- Code: --- Here is the main script, your duel managers item tag should be the name of
this script:
*NOTE* You must change the "AreaTag1" and AreaTag2" to the tags of the
areas where duels are allowed (you can add or remove areas if you wish)
QUOTE
//Duel Handling System
//By: 420 6/25/04
//This script should have the same name as the tag of the item that is
used to
//request a duel from another player. This script needs the script
"endduel" and alterations
//to the OnDeath, OnClientEnter and OnClientLeave scripts. As well as any
area
//OnExit scripts to which the duels are restricted.
void main()
{
//Declare all (or most) of the variables
effect eWait = SupernaturalEffect(EffectCutsceneParalyze());
effect eInDuel =
SupernaturalEffect(EffectVisualEffect(VFX_DUR_IOUNSTONE_GREEN));
effect eUnsummon = EffectVisualEffect(VFX_IMP_UNSUMMON);
effect eParalyzed =
SupernaturalEffect(EffectVisualEffect(VFX_DUR_PARALYZED));
object oSelf = GetItemActivator();
string sSelf = GetPCPlayerName(oSelf);
string sSelfName = GetName(oSelf);
object oTarget = GetItemActivatedTarget();
string sTarget = GetPCPlayerName(oTarget);
string sTargetName = GetName(oTarget);
string sArea = GetTag(GetArea(oSelf));
string sActiveDuel = GetLocalString(oSelf, "ActiveDuel");
string sActiveDuelT = GetLocalString(oTarget, "ActiveDuel");
object oAssociate;
//When the item is activated it will have one of the following effects:
//
//If the activator is in a confirmed duel, set the "DuelAborted" variable
on the
//activator then kill the activator.
if(sActiveDuel != "")
{
SetLocalInt(oSelf, "DuelAborted", 1);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(TRUE), oSelf);
}
//If the activator is not in the right area the item doesn't work and the
activator is
//told the reason.
else if(sArea != "AreaTag1" ||
sArea != "AreaTag2" )
{
FloatingTextStringOnCreature("This item cannot be used in this area.",
oSelf);
}
//If the target is not a PC or if the activator targets itself the item
doesn't
//work and the activator is told the reason.
else if(GetIsPC(oTarget) == FALSE ||
(oSelf == oTarget))
{
FloatingTextStringOnCreature("Invalid target.", oSelf);
}
//If the target of the item is in a duel the item does nothing and the
activator is
//told the reason.
else if(sActiveDuelT != "")
{
FloatingTextStringOnCreature("Target is currently in a duel.", oSelf);
}
//If the activator targets someone who hasn't requested a duel then
request a duel.
else if(GetLocalInt(oTarget, sSelf) == 0)
{
FloatingTextStringOnCreature("You have requested a duel with
"+sTargetName+".", oSelf);
FloatingTextStringOnCreature(sSelfName+" has requested a duel with
you.", oTarget);
SetLocalInt(oSelf, sTarget, 1);
DelayCommand(60.0, DeleteLocalInt(oSelf, sTarget));
}
//If the script gets this far then the activator has targeted a PC that
requested
//a duel no more than 1 minute ago. Start a duel with that PC.
else
{
//Remove the Duel Request local variable from the requester
DeleteLocalInt(oTarget, sSelf);
//Set an active duel local variable on both players with their
opponents account
//name.
SetLocalString(oSelf, "ActiveDuel", sTarget);
SetLocalString(oTarget, "ActiveDuel", sSelf);
//Remove them from any party
RemoveFromParty(oTarget);
RemoveFromParty(oSelf);
//Make them both rest instantly to remove spell effects/memorize spells
and ready
//feats.
ForceRest(oTarget);
ForceRest(oSelf);
//Destroy any summoned familiars/animal companions
//*note* This will only work if the PCs only have a max of 2 familiars
and
//2 animal companions.
oAssociate = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oTarget, 1);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
oAssociate = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oTarget, 1);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
oAssociate = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oTarget, 2);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
oAssociate = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oTarget, 2);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
oAssociate = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oSelf, 1);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
oAssociate = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oSelf, 1);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
oAssociate = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oSelf, 2);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
oAssociate = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oSelf, 2);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eUnsummon,
GetLocation(oAssociate));
DestroyObject(oAssociate);
//Set the PCs hostile to each other
SetPCDislike(oTarget, oSelf);
//Paralyze them for 1 round (6 seconds) slap a "Active Duel" graphic on
them
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eWait, oTarget, 6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eWait, oSelf, 6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyzed, oTarget, 6.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyzed, oSelf, 6.0);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInDuel, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInDuel, oSelf);
//Count down message for both players.
DelayCommand(2.0, FloatingTextStringOnCreature("Ready.", oTarget));
DelayCommand(2.0, FloatingTextStringOnCreature("Ready.", oSelf));
DelayCommand(4.0, FloatingTextStringOnCreature("Set.", oTarget));
DelayCommand(4.0, FloatingTextStringOnCreature("Set.", oSelf));
DelayCommand(6.0, FloatingTextStringOnCreature("Go!", oTarget));
DelayCommand(6.0, FloatingTextStringOnCreature("Go!", oSelf));
}
}
This script must be called "endduel":
QUOTE
//Duel Handling System
//By: 420 6/25/04
//*NOTE*: This script must be called "endduel"
//This script handles ending the duel and resetting the PCs to their state
before
//the duel, it removes the "Active Duel" local variable and visual effect
void main()
{
DeleteLocalString(OBJECT_SELF, "ActiveDuel");
effect eEffect = GetFirstEffect(OBJECT_SELF);
while(GetIsEffectValid(eEffect) == TRUE)
{
if(GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT &&
GetEffectSubType(eEffect) == SUBTYPE_SUPERNATURAL)
{
RemoveEffect(OBJECT_SELF, eEffect);
}
eEffect = GetNextEffect(OBJECT_SELF);
}
}
Place this script in the Modules OnClientLeave event trigger:
QUOTE
//Duel Handling System
//By: 420 6/25/04
//This script should be added to the OnClientLeave Module Properties event
trigger.
//If the person leaving the server was in a duel this will find their
opponent and
//inform then that the PC left and the duel was aborted. Then it will run
the
//"endduel" script.
void main()
{
object oTarget = GetExitingObject();
string sTarget = GetLocalString(oTarget, "Account");
string sActiveDuel = GetLocalString(oTarget, "ActiveDuel");
object oOpponent;
if(sActiveDuel != "")
{
oOpponent = GetFirstPC();
while(oOpponent != OBJECT_INVALID)
{
if(GetLocalString(oOpponent, "ActiveDuel") == sTarget)
{
FloatingTextStringOnCreature("Your opponent left.", oOpponent);
DelayCommand(1.0, FloatingTextStringOnCreature("You won the
duel.", oOpponent));
SetPCLike(oTarget, oOpponent);
ForceRest(oOpponent);
ExecuteScript("endduel", oOpponent);
}
oOpponent = GetNextPC();
}
}
}
This script should be placed in the OnExit event trigger of all areas
where duels are allowed:
QUOTE
//Duel Handling System
//By: 420 6/25/04
//This script should be put in the OnExit event triggers of any areas that
allow
//duels. If someone leaves the area (but not the server) then set the
"DuelAborted"
//local variable and kill the PC.
void main()
{
object oTarget = GetExitingObject();
string sActiveDuel = GetLocalString(oTarget, "ActiveDuel");
if(sActiveDuel != "" &&
GetPCPlayerName(oTarget) != "")
{
SetLocalInt(oTarget, "DuelAborted", 1);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(TRUE), oTarget);
}
}
This file replaces Bioware's crappy default OnDeath module event trigger:
*NOTE* You must change the "AreaTag1" and "AreaTag2" to the same tags as
the ones in the main Duel Manager script. (ie the 2 areas where duels are
allowed.)
QUOTE
//Created by 420 because he is fed up with Bioware's crappy scripting.
//This should replace the Module Properties OnDeath event trigger.
//6/27/04
void Raise(object oPlayer)
{
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
effect eBad = GetFirstEffect(oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)),
oPlayer);
//Search for negative effects
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE
||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) ==
EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
{
//Remove effect if it is negative.
RemoveEffect(oPlayer, eBad);
}
eBad = GetNextEffect(oPlayer);
}
//Fire cast spell at event for the specified target
SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF,
SPELL_RESTORATION, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}
void main()
{
object oPlayer = GetLastPlayerDied();
string sArea = GetTag(GetArea(oPlayer));
string sSelf = GetPCPlayerName(oPlayer);
string sActiveDuel = GetLocalString(oPlayer, "ActiveDuel");
int iAborted = GetLocalInt(oPlayer, "DuelAborted");
object oOpponent;
// * increment global tracking number of times that I died
SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer,
"NW_L_PLAYER_DIED") + 1);
// * make friendly to Each of the 3 common factions
AssignCommand(oPlayer, ClearAllActions());
// * Note: waiting for Sophia to make SetStandardFactionReptuation to
clear all personal reputation
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <=
10)
{
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <=
10)
{
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <=
10)
{
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
}
//If the dead PC was in a duel inform them that they lost and inform their
opponent
//of the win. If the dead PC aborted the duel inform them both of that.
if (sActiveDuel != "")
{
oOpponent = GetFirstPC();
while(oOpponent != OBJECT_INVALID)
{
if(GetLocalString(oOpponent, "ActiveDuel") == sSelf)
{
if(iAborted == 1)
{
FloatingTextStringOnCreature("You aborted the duel.",
oPlayer);
FloatingTextStringOnCreature("Your opponent aborted the
duel.", oOpponent);
DeleteLocalInt(oPlayer, "DuelAborted");
}
DelayCommand(1.0, FloatingTextStringOnCreature("You won the
duel.", oOpponent));
SetPCLike(oPlayer, oOpponent);
ForceRest(oOpponent);
ExecuteScript("endduel", oOpponent);
}
oOpponent = GetNextPC();
}
DelayCommand(1.0, FloatingTextStringOnCreature("You lost the duel.",
oPlayer));
DelayCommand(6.1, ForceRest(oPlayer));
ExecuteScript("endduel", oPlayer);
}
//Put the tags of the areas where duels are allowed.
if (sArea == "AreaTag1" ||
sArea == "AreaTag2")
{
DelayCommand(6.0, Raise(oPlayer));
return;
}
DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));
}
I had to add a couple lines to the modules OnClientEnter script, here is
an example:
QUOTE
//Check "Official" status, give item to Officials
//by: 420 6/25/04
//Put in the OnClientEnter event trigger of the Module Properties
void main()
{
object oTarget = GetEnteringObject();
string sCDKey = GetPCPublicCDKey(oTarget);
int iOfficial = GetCampaignInt("Official", sCDKey, oTarget);
if(iOfficial == 1)
{
DelayCommand(1.0, CreateItemOnObject("itemsblueprintresref", oTarget));
}
ExecuteScript("420itemfilter", oTarget);
//420 6/28/04 Set the account name as a local variable so it can be
retrieved by
//OnClientLeave
SetLocalString(oTarget, "Account", GetPCPlayerName(oTarget));
//420 6/29/04 If entering PC left during a duel, run the "endduel" script
if (GetLocalString(oTarget, "ActiveDuel") != "")
{
ExecuteScript("endduel", oTarget);
}
}
--- End code ---
Blood Angel:
lol, how many pages of that can we expect if all is uploaded? just an approximate number ;)
gashmo:
it's easy to get a script which works almost like gs
just go to nwvault and do a search for "mooscript" or "butcha" - they have posted 2 legit pvp scripts which will do most of what gs does. gs does a lot of very fine tweak checking - but its not really needed cos heck, a bit of tweaking is fun anyway.
if u want to make it mor elike gs, make sur eto go through the script and enbale all sections removing "resist" etc..
Tea-cup:
--- Quote ---it's easy to get a script which works almost like gs
[snapback]10567[/snapback]
--- End quote ---
Can't agree whit that. Or we have completly different opinions about 'almost like'.
To have the same pvp as on gs you need quite a load of scripts. Just a basic filter won't do the job.
Anyway, it's a nice idea to check those script, they aren't bad and you have to start somewhere.
-Mel
Navigation
[0] Message Index
[#] Next page
Go to full version