Gimli Oakenshield L'ignorant en Hardware
Nombre de messages : 783 Localisation : Près de mon ordi ! Date d'inscription : 15/12/2005
| Sujet: Le déco reco pour la mort Dim 19 Fév - 0:13 | |
| Tout les scripts ont été édité et ajouté a ceux déja présents sur Aelor Ceci dans le " oncliententer " - Code:
-
#include "cnr_recipe_utils"
void main() { object oPC = GetEnteringObject(); object oWay = GetWaypointByTag("ARRIVEEDM");
int BALISE_MORT = GetCampaignInt("Aelor","balise_mort", oPC);
if(BALISE_MORT == TRUE ) { //// effect eDeath = EffectDeath(FALSE, FALSE); ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oPC); }
if (!GetIsPC(oPC)) return;
/////////////////////////////////////////////////////////// // Make sure all players carry the new Tradeskill Journal. ///////////////////////////////////////////////////////////
// First, check if they have either journal, new or old. object oJournal = CnrGetItemByResRef("cnrtradejournal", oPC); if (oJournal == OBJECT_INVALID) { ////////////////////////// // First time in module.... //////////////////////////
// create a journal for the player oJournal = CreateItemOnObject("cnrtradejournal", oPC); } else { // The player has a journal. Now determine what type it is, new or old
if (GetTag(oJournal) != "cnrTradeJournal") { // Player has the old type journal. We need to convert the XP stored in its tag // to the new format, then we can destroy the old journal and create a new journal.
CnrConvertOldJournalXPToNewFormat(oJournal, oPC); DestroyObject(oJournal); CreateItemOnObject("cnrtradejournal", oPC); } }
// Allow the builder to set the trade level caps for this PC. // execute hook script ExecuteScript("hook_set_lev_cap", oPC);
int bInitRecipesOnModuleLoad = CnrGetPersistentInt(OBJECT_SELF, "CnrBoolInitRecipesOnModuleLoad"); bInitRecipesOnModuleLoad = bInitRecipesOnModuleLoad || CNR_BOOL_INIT_RECIPES_ON_MODULE_LOAD; if (bInitRecipesOnModuleLoad == TRUE) { int nRecipeCount = GetLocalInt(GetModule(), "CnrRecipeCount"); SendMessageToPC(oPC, "Total CNR recipe count = " + IntToString(nRecipeCount)); }
if(GetIsDM(oPC)) { DelayCommand(2.0,AssignCommand(oPC,ActionJumpToLocation(GetLocation(oWay)))); CreateItemOnObject("bag_met_a_0",oPC); CreateItemOnObject("bag_mauvais",oPC); CreateItemOnObject("bag_loyal",oPC); CreateItemOnObject("bag_chaos",oPC); CreateItemOnObject("bag_bon",oPC); } else if(GetXP(oPC) == 0) { TakeGoldFromCreature(GetGold(oPC),oPC,TRUE); GiveGoldToCreature(oPC,100); GiveXPToCreature(oPC,1000); CreateItemOnObject("baton_emote",oPC); } } mettre ceci dans le " onplayerdeath " : - Code:
-
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(); SetCampaignInt("Aelor","balise_mort",TRUE,oPlayer); // * increment global tracking number of times that I died SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1);
// * BK: Automation Control. Autopcs ignore death if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10) { Raise(oPlayer); DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF)); return; // Raise and return }
// * Handle Spirit of the Wood Death string sArea = GetTag(GetArea(oPlayer)); if(GetIsPC(GetLastKiller())== TRUE) { SetLocalInt(oPlayer,"tue_par_pc",TRUE); } else { SetLocalInt(oPlayer,"tue_par_pc",FALSE); } // * 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); }
DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));
} Dans le " onplayerrespawn " : - Code:
-
#include "nw_i0_plot"
// * Applies an XP and GP penalty // * to the player respawning void ApplyPenalty(object oDead) {
int nXP = GetXP(oDead); int nPenalty = 30 * 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(); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); RemoveEffects(oRespawner); //* Return PC to temple
SetCampaignInt("Aelor","balise_mort",FALSE,oRespawner);
string sDestTag = "NW_DEATH_TEMPLE"; string sArea = GetTag(GetArea(oRespawner));
if (GetIsObjectValid(GetObjectByTag(sDestTag))) {
if (sDestTag == "NW_DEATH_TEMPLE") { object oPriest = GetObjectByTag("NW_DEATH_CLERIC"); //SetLocalInt(oPriest, "NW_L_SAYONELINER", 10);
//AssignCommand(oPriest, DelayCommand(3.0,ActionStartConversation(oRespawner))); AssignCommand(oPriest, DelayCommand(2.1, PlayVoiceChat(VOICE_CHAT_TALKTOME, oPriest)));
SetLocalLocation(oRespawner, "NW_L_I_DIED_HERE", GetLocation(GetLastRespawnButtonPresser())); SetLocalInt(oRespawner, "NW_L_I_DIED", 1); SetLocalObject(oPriest, "NW_L_LASTDIED", GetLastRespawnButtonPresser()); // * April 2002: Moved penalty here, only when going back to the death temple
//////////////////////////////////////////////////////////////////////////// if(GetLocalInt(oRespawner,"tue_par_pc")==FALSE) ApplyPenalty(oRespawner);
} object oSpawnPoint = GetObjectByTag(sDestTag); AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint))); // * mak } else { // * do nothing, just 'res where you are. } } Le suivant sous le nom "nw_s0_raisdead" : - Code:
-
void main() { //AdjustAlignment( OBJECT_SELF, ALIGNMENT_GOOD, 2); //Declare major variables object oCaster = OBJECT_SELF; object oTarget = GetSpellTargetObject(); effect eRaise = EffectResurrection(); effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
////////////////////////////// ////////////////////////////// ////////////
//---------------------------- ----------------------------// // Positionement de la balise de mort a " FALSE " // //---------------------------- ----------------------------// int BALISE_MORT = GetCampaignInt("Aelor","balise_mort",oTarget); SetCampaignInt("Aelor","balise_mort",FALSE,oTarget);
////////////////////////////// ////////////////////////////// ////////////
if(GetIsDead(oTarget)) { //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_RAISE_DEAD, FALSE)); //Apply raise dead effect and VFX impact ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
SetLocalInt(GetModule(),GetName(oTarget)+GetPCPublicCDKey(oTarget)+"Damages",0); if (GetIsPC(oCaster) && GetIsPC(oTarget)) WriteTimestampedLogEntry("[PK]"+GetName(oCaster)+" casted raised dead on "+GetName(oTarget)); }
} Et sauvegarder le script suivant sous le nom "nw_s0_resserec" : - Code:
-
void main() { //AdjustAlignment( OBJECT_SELF, ALIGNMENT_GOOD, 3); //Get the spell target object oTarget = GetSpellTargetObject(); object oCaster = OBJECT_SELF; //Check to make sure the target is dead first
//---------------------------- ------------------------------ ----------------// // Positionement de la balise de mort a " FALSE " // //---------------------------- ------------------------------ ----------------// int BALISE_MORT = GetCampaignInt("Aelor","balise_mort",oTarget); SetCampaignInt("Aelor","balise_mort",FALSE,oTarget); //---------------------------- ------------------------------ ----------------//
if (GetIsDead(oTarget)) { //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_RESURRECTION, FALSE)); //Declare major variables int nHealed = GetMaxHitPoints(oTarget); effect eRaise = EffectResurrection(); effect eHeal = EffectHeal(nHealed + 10); effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD); //Apply the heal, raise dead and VFX impact effect ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget); ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget); ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
SetLocalInt(GetModule(),GetName(oTarget)+GetPCPublicCDKey(oTarget)+"Damages",0);
if (GetIsPC(oCaster) && GetIsPC(oTarget)) WriteTimestampedLogEntry("[PK]"+GetName(oCaster)+" casted resurrection on "+GetName(oTarget));
} } | |
|