Ninfablanca

07/11/2005 20:00:52

Wolaps, me gustaría haser un sistema de muerte supongo que como el tipico de todos los servers, en el que cuando se te transporte a un lugar diferente y se te rste algo de px y quería saber si álguien sabe como hacerlo y si es muy dificil. Lili porfi si tienes alguno por ahí y tapetece enseñarme me harías un grandisimo favor :)

Mandrake

07/11/2005 22:00:52

Yo, antaño, cuando tenia mi querido server de arena usaba este script:

http://www.lascosasclaras.com/public/davidib/61526_mod_onrespawn.rar


Y luego para agregar perdidas de px y oro hay que ponerle esto:

[quote:a5cca366b5]void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
int nPenalty = 50 * 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));

}[/quote:a5cca366b5]




Luego es ajustar numeros para que salga como quieras... :D

Mandrake

07/11/2005 22:05:42

Una cosa mas, el script va, si no recuerdo mal en los eventos del modulo en OnPlayerRespawn. Creo, hace meses que no toco el never :D

Ninfablanca

08/11/2005 12:08:16

muxas gracias voy a ver si me aclaro jeje

Ninfablanca

09/11/2005 17:23:46

por cierto, ese scrip que me das hay que ponerlo tal cual? con el void ese y todo? esque luego intento compilar y me da error.

Ninfablanca

09/11/2005 17:24:35

salvo si lo hago despues de que cierre la ultima llave del void main que venía.

Mandrake

09/11/2005 20:55:51

Creo que si que es asi tal cual.... Hace mucho que no lo toco ese script, si acaso el tito althor o Lili que te echen un cable :D

Ninfablanca

09/11/2005 23:31:50

hum... pero eso de la px no hay que ponerlo en ningún otro guión de propiedades del modulo aparte o algo? esque así me teleporta, pero no me quita la px ni el oro.

10/11/2005 10:39:47

Te voy aponer lo qu eyo tengo, es que quitar todo lo que sobra y tal es un royo, pilla lo que te haga falta.

En el OnPlayerDying del modulo

[code:1:1de9c47f9b]
//::///////////////////////////////////////////////
//:: Dying Script
//:: s_dying.NSS
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a character is dying. Dying
is when the character is between 0 and -9 hit
points; -10 and below is death. To use, redirect
the OnDying event script of the module to this script.
*/
//:://////////////////////////////////////////////
//:: Author : Scott Thorne
//:: E-mail : Thornex2@wans.net
//:: Updated: July 25, 2002
//:://////////////////////////////////////////////
void bleed(int iBleedAmt)
{
effect eBleedEff;
effect eDeath = EffectDeath(FALSE, FALSE);
object oAtacante = GetLastHostileActor(OBJECT_SELF);

AssignCommand(oAtacante, ClearAllActions(TRUE));

/* keep executing recursively until character is dead or at +1 hit points */
if (GetCurrentHitPoints() <= 0)
{

/* a positive bleeding amount means damage, otherwise heal the character */
if (iBleedAmt > 0)
{
eBleedEff = EffectDamage(iBleedAmt);
}
else
{
eBleedEff = EffectHeal(-iBleedAmt); /* note the negative sign */
}

ApplyEffectToObject(DURATION_TYPE_INSTANT, eBleedEff, OBJECT_SELF);

/* -10 hit points is the death threshold, at or beyond it the character dies */
if (GetCurrentHitPoints() <= -10)
{
//PlayVoiceChat(VOICE_CHAT_DEATH); /* scream one last time */
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), OBJECT_SELF); /* make death dramatic */
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, GetLastPlayerDying()); /* now kill them */
return;
}

if (iBleedAmt > 0)
{ /* only check if character has not stablized */
if (d10(1) == 1)
{ /* 10% chance to stablize */
iBleedAmt = -iBleedAmt; /* reverse the bleeding process */
PlayVoiceChat(VOICE_CHAT_LAUGH); /* laugh at death -- this time */
}
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)); /* do this again next round */
}
}


void main()
{
object oDying = GetLastPlayerDying();
int iPetrificado = 0;
effect eDamage = EffectDamage( 10, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY );

//Comprobando si el PJ esta petrificado
effect eEfecto = GetFirstEffect(oDying);
while(GetIsEffectValid(eEfecto))
{
if(GetEffectType(eEfecto) == EFFECT_TYPE_PETRIFY) iPetrificado = 1;
eEfecto = GetNextEffect(oDying);
}
AssignCommand(oDying, ClearAllActions(TRUE));
if (!iPetrificado && !GetLocalInt(oDying,"arena")) AssignCommand(oDying, bleed(1));
else ApplyEffectToObject( DURATION_TYPE_INSTANT, eDamage, oDying );
}
[/code:1:1de9c47f9b]

En el OnPlayerDeath del modulo

[code:1:1de9c47f9b]
//::///////////////////////////////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a player dies.

BK: October 8 2002: Overriden for Expansion
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////
/*
void ClearAllFactionMembers(object oMember, object oPlayer)
{
// AssignCommand(oMember, SpeakString("here"));
AdjustReputation(oPlayer, oMember, 100);
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
object oClear = GetFirstFactionMember(oMember, FALSE);
while (GetIsObjectValid(oClear) == TRUE)
{
ClearPersonalReputation(oPlayer, oClear);
oClear = GetNextFactionMember(oMember, FALSE);
}
} */

#include "sistemas_ro_cfg"
#include "rofaerun_inc"
#include "nw_i0_plot"

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 RegenAutomatica(object oPC)
{
if (GetIsDead(oPC))
{
effect eDeath = EffectDeath(FALSE, FALSE);
object theWaypoint = GetWaypointByTag("SOP_LimboArtesanos");


if(HasItem(oPC, "sop_mortperm"))
{
DelayCommand(10.0, ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPC));
DelayCommand(10.1, ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPC)), oPC));
DelayCommand(11.0, AssignCommand(oPC, JumpToLocation(GetLocation(theWaypoint))));
DelayCommand(12.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oPC));
}
}
}

void ComprobarMuerte(object oPJ)
{
SetLocalLocation(oPJ, "LugarMuerte", GetLocation(oPJ));
if (GetIsDead(oPJ))
{
if (GetLocalInt(oPJ,"arena"))
{
DelayCommand(1.0, PopUpDeathGUIPanel(oPJ, TRUE, TRUE, 0, "Si pulsas regenerar, no sufriras penalizaciones."));
}
else if (HasItem(oPJ, "sop_artesano") || HasItem(oPJ, "sop_mortalidad"))
{
DelayCommand(1260.0, RegenAutomatica(oPJ));
SendMessageToPC(oPJ, "Tienes 18 minutos para ser resucitado.");
}
else PopUpGUIPanel(oPJ,GUI_PANEL_PLAYER_DEATH);
}

}

void main()
{

object oPlayer = GetLastPlayerDied();
int nRace = GetRacialType(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 (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oPlayer)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
{
int bValid;

Raise(oPlayer);
string sDestTag = "WP_M2Q2GtoM2Q2F";
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)));
return;

}
*/
// * in last level of the Sourcestone, move the player to the beginning of the area
// * May 16 2002: or the main area of the Snowglobe (to prevent plot logic problems).
// * May 21 2002: or Castle Never
if (sArea == "M4Q1D2" || sArea == "M3Q3C" || sArea == "MAP_M1Q6A")
{

//Raise(oPlayer);
//string sDestTag = "M4QD07_ENTER";
//object oSpawnPoint = GetObjectByTag(sDestTag);
// AssignCommand(oPlayer, DelayCommand(1.0, JumpToLocation(GetLocation(oSpawnPoint))));
// * MAY 2002: Just popup the YOU ARE DEAD panel at this point
DelayCommand(2.5, PopUpDeathGUIPanel(oPlayer,FALSE, TRUE, 66487));
return;
}

// * make friendly to Each of the 3 common factions
AssignCommand(oPlayer, ClearAllActions(TRUE));
// * 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 ((nRace == RACIAL_TYPE_ELF && GetStringLowerCase(GetSubRace(oPlayer)) == "drow")
|| (nRace == RACIAL_TYPE_DWARF && GetStringLeft(GetStringLowerCase(GetSubRace(oPlayer)), 7) == "duergar"))
{
SendMessageToPC(oPlayer, "Resueltas hostilidades entre razas.");
}
else
{
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
{
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
}
}
//Arena
if (GetLocalInt(oPlayer,"arena"))
{
SpeakOneLinerConversation("**Cae al suelo inconsciente.**", oPlayer);
SetLocalInt(oPlayer, "CuradoArena", 0);
}
else
{
if (HasItem(oPlayer, "sop_artesano") || HasItem(oPlayer, "sop_mortalidad")) CreateItemOnObject("sop_mortperm", oPlayer, 1);
else CreateItemOnObject("muerte", oPlayer, 1);
}

DelayCommand(20.0, ComprobarMuerte(oPlayer));

}
[/code:1:1de9c47f9b]

En el OnPlayerRespawn del modulo

[code:1:1de9c47f9b]
//::///////////////////////////////////////////////
//:: The following on Respawn event is based on
//:: Generic On Pressed Respawn Button
//:: Copyright (c) 2001 Bioware Corp.
//:: Created By: Brent
//:: Created On: November
//:://////////////////////////////////////////////

#include "nw_i0_plot"
#include "rofaerun_inc"

void main ()
{
object oRespawner = GetLastRespawnButtonPresser() ;
int nRace = GetRacialType(oRespawner);
string sDestTag;
object oSpawnPoint;
int iArenaZona = GetLocalInt(oRespawner, "arena");
SendMessageToPC(oRespawner, "iArenaZona= "+IntToString(iArenaZona));

//Salta penalizadores si estas en Arena
if (iArenaZona == 1)
{
SendMessageToPC(oRespawner, "Estas en una Zona Arena");
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(1 - (GetCurrentHitPoints(oRespawner))), oRespawner);
object oPuntoRegera = GetNearestObjectByTag("arena_respawn", oRespawner);
AssignCommand(oRespawner, JumpToLocation(GetLocation(oPuntoRegera)));
if (oPuntoRegera == OBJECT_INVALID) SendMessageToPC( oRespawner, "Punto de regeneracion no valido");
return;
}

if(nRace == RACIAL_TYPE_ELF && GetStringLowerCase(GetSubRace(oRespawner)) == "drow")
{
sDestTag = "RESPAWN_DROW";
}
else
{
sDestTag = "RESPAWN_HUMAN";
}
oSpawnPoint = GetObjectByTag(sDestTag);

ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects (oRespawner) ;
ApplyPenalty(oRespawner);
DelayCommand(0.1, AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint))));
//******************************************************************************
//* Restriccion al nivel de los objetos por script
//******************************************************************************
//Desequipando objetos de mayor nivel que el PJ
DelayCommand(5.0, CF_DesequipadoObjetos(oRespawner));
}
[/code:1:1de9c47f9b]

Evidentemente hay muchas cosas de mi modulo....ah por ultimo esta libreria

[code:1:1de9c47f9b]
//******************************************************************************
// Funciones especiales para el modulo
// Autor: Tomas Gomez
//******************************************************************************

#include "jhr_i0_pipe"
#include "cf_sp_detectevil"
#include "sistemas_ro_cfg"

void ApplyPenalty(object oDead);
void DestruirInventario(object oObjeto);
void CF_DesequipadoObjetos(object oPlayer);
int CF_ObtenNivelObjeto(object oItem);
void CF_OnActivateItem(object oItem, object oActivator, object oTarget, location lLugar);
void CF_CompContraConjuro(object oPC);

void ApplyPenalty(object oDead)
{
//Configuracion de la funcion
int iPenalizacionXP = 4; //Penalizacionde de experiencia en tanto por cien 0-100
float iPenalizacionPG = 0.1; //Penalizacion en oro en tanto por 1

int nXP = GetXP(oDead) ; //Obtencion de la experiencia del jugador
int nPenalty;
int nGoldToTake;
int nHD = GetHitDice(oDead) ; //Obtencion del nivel del jugador
object oBolsaOro;
location lLugarDead = GetLocation(oDead) ;// Obtengo la localizacion del muerto

//Penalizacion de XP variable
if(nHD>=1 && nHD<=5) iPenalizacionXP = 1;
if(nHD>=6 && nHD<=10) iPenalizacionXP = 2;
if(nHD>=11 && nHD<=15) iPenalizacionXP = 4;
if(nHD>=16 && nHD<=40) iPenalizacionXP = 6;

//Penalizacion en XP
nPenalty = (iPenalizacionXP * nXP)/100 ; //Calculo de cantidad de XP a perder
//int nMin = ((nHD * (nHD - 1)) / 2) * 1000 ; //Prevencion de perdida de nivel
int nNewXP = nXP - nPenalty ;
//if (nNewXP < nMin) nNewXP = nMin; //Prevencion de perdida de nivel
if (nNewXP<=0) nNewXP=10; //Prevencion para que el jugador no quede con 0 de XP
SetXP(oDead, nNewXP); //Ajustamos al jugador con la nueva XP

//Penalizacion en Oro
nGoldToTake = FloatToInt(iPenalizacionPG * GetGold(oDead)); //Cantidad de oro a quitar
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); //Quito el oro al jugador
//Creacion de la bolsa donde estara el oro perdido
oBolsaOro = CreateObject(OBJECT_TYPE_PLACEABLE, "cf_oroperdido", lLugarDead);
CreateItemOnObject("nw_it_gold001", oBolsaOro, nGoldToTake);

// Textos de "Perdida de GP" y "Perdida de XP" despues de regenerar.
DelayCommand(2.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)) ; //XP texto
DelayCommand(2.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)) ; //GP texto
}

void DestruirInventario(object oObjeto)
{
object oItem = GetFirstItemInInventory(oObjeto);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oObjeto);
}
}

void CF_DesequipadoObjetos(object oPlayer)
{
int iNivelPJ = GetHitDice(oPlayer);
object oObjetoInventario;
int iNivelObjeto;

if (!GetIsDM(oPlayer)){
oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_HEAD, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_CHEST, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_RIGHTHAND, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_LEFTHAND, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_ARROWS, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_BOLTS, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_BULLETS, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_BELT, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_RIGHTRING, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_LEFTRING, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_ARMS, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_CLOAK, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));

oObjetoInventario = GetItemInSlot (INVENTORY_SLOT_BOOTS, oPlayer);
iNivelObjeto = CF_ObtenNivelObjeto(oObjetoInventario);
if (iNivelObjeto > iNivelPJ) AssignCommand(oPlayer, ActionUnequipItem (oObjetoInventario));}
}

int CF_ObtenNivelObjeto(object oItem)
{
int iValorObjeto = GetGoldPieceValue(oItem);
if (iValorObjeto == 0) return 0;
if (iValorObjeto >= 1 && iValorObjeto <= 1000) return 1;
if (iValorObjeto >= 1001 && iValorObjeto <= 1500) return 2;
if (iValorObjeto >= 1501 && iValorObjeto <= 2500) return 3;
if (iValorObjeto >= 2501 && iValorObjeto <= 3500) return 4;
if (iValorObjeto >= 3501 && iValorObjeto <= 5000) return 5;
if (iValorObjeto >= 5001 && iValorObjeto <= 6500) return 6;
if (iValorObjeto >= 6501 && iValorObjeto <= 9000) return 7;
if (iValorObjeto >= 9001 && iValorObjeto <= 12000) return 8;
if (iValorObjeto >= 12001 && iValorObjeto <= 15000) return 9;
if (iValorObjeto >= 15001 && iValorObjeto <= 19500) return 10;
if (iValorObjeto >= 19501 && iValorObjeto <= 25000) return 11;
if (iValorObjeto >= 25001 && iValorObjeto <= 30000) return 12;
if (iValorObjeto >= 30001 && iValorObjeto <= 35000) return 13;
if (iValorObjeto >= 35001 && iValorObjeto <= 40000) return 14;
if (iValorObjeto >= 40001 && iValorObjeto <= 50000) return 15;
if (iValorObjeto >= 50001 && iValorObjeto <= 65000) return 16;
if (iValorObjeto >= 65001 && iValorObjeto <= 75000) return 17;
if (iValorObjeto >= 75001 && iValorObjeto <= 90000) return 18;
if (iValorObjeto >= 90001 && iValorObjeto <= 110000) return 19;
if (iValorObjeto >= 110001 && iValorObjeto <= 130000) return 20;
if (iValorObjeto >= 130001 && iValorObjeto <= 250000) return 21;
if (iValorObjeto >= 250001 && iValorObjeto <= 500000) return 22;
if (iValorObjeto >= 500001 && iValorObjeto <= 750000) return 23;
if (iValorObjeto >= 750001 && iValorObjeto <= 1000000) return 24;
if (iValorObjeto >= 1000001 && iValorObjeto <= 1200000) return 25;
if (iValorObjeto >= 1200001 && iValorObjeto <= 1400000) return 26;
if (iValorObjeto >= 1400001 && iValorObjeto <= 1600000) return 27;
if (iValorObjeto >= 1600001 && iValorObjeto <= 1800000) return 28;
if (iValorObjeto >= 1800001 && iValorObjeto <= 2000000) return 29;
if (iValorObjeto >= 2000001 && iValorObjeto <= 2200000) return 30;
if (iValorObjeto >= 2200001 && iValorObjeto <= 2400000) return 31;
if (iValorObjeto >= 2400001 && iValorObjeto <= 2600000) return 32;
if (iValorObjeto >= 2600001 && iValorObjeto <= 2800000) return 33;
if (iValorObjeto >= 2800001 && iValorObjeto <= 3000000) return 34;
if (iValorObjeto >= 3000001 && iValorObjeto <= 3200000) return 35;
if (iValorObjeto >= 3200001 && iValorObjeto <= 3400000) return 36;
if (iValorObjeto >= 3400001 && iValorObjeto <= 3600000) return 37;
if (iValorObjeto >= 3600001 && iValorObjeto <= 3800000) return 38;
if (iValorObjeto >= 3800001 && iValorObjeto <= 4000000) return 39;
if (iValorObjeto >= 4000001 && iValorObjeto <= 4200000) return 40;
if (iValorObjeto >= 4200001) return 999;
return 0;
}

void CF_OnActivateItem(object oItem, object oActivator, object oTarget, location lLugar)
{
if (GetTag(oItem) == "BookOfSummons") //Libro de Convocaciones
{
AssignCommand(oActivator,ActionStartConversation(oActivator,"hc_c_bookofsummo",TRUE));
return;
}
if (GetTag(oItem) == "Yescas") //Yescas para hogueras
{
CreateObject(OBJECT_TYPE_PLACEABLE, "hoguera", lLugar);
return;
}
if(GetTag(oItem)=="Marcador")
{
if (!(GetLevelByClass(CLASS_TYPE_SORCERER, oActivator) >= 1) &&
!(GetLevelByClass(CLASS_TYPE_WIZARD, oActivator) >= 1) &&
!(GetLevelByClass(CLASS_TYPE_CLERIC, oActivator) >= 1) &&
!(GetLevelByClass(CLASS_TYPE_DRUID, oActivator) >= 1))
{
SetCampaignLocation(BD_SPER, "PosMarcador", lLugar, oActivator);
return;
}
if ((GetLevelByClass(CLASS_TYPE_SORCERER, oActivator) >= 9) ||
(GetLevelByClass(CLASS_TYPE_WIZARD, oActivator) >= 9) ||
(GetLevelByClass(CLASS_TYPE_CLERIC, oActivator) >= 11) ||
(GetLevelByClass(CLASS_TYPE_DRUID, oActivator) >= 15))
{
SetCampaignLocation(BD_SPER, "PosMarcador", lLugar, oActivator);
}
else
{
SendMessageToPC(oActivator, "No tienes suficiente nivel para usar este conjuro.");
}
return;
}
if(GetTag(oItem)=="Palabraderegreso")
{
if (!(GetLevelByClass(CLASS_TYPE_CLERIC, oActivator) >= 1) &&
!(GetLevelByClass(CLASS_TYPE_DRUID, oActivator) >= 1))
{
location lPosMarcador = GetCampaignLocation(BD_SPER, "PosMarcador", oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), oActivator);
DelayCommand(1.5, AssignCommand(oActivator, JumpToLocation(lPosMarcador)));
DestroyObject(oItem);
return;
}
if ((GetLevelByClass(CLASS_TYPE_CLERIC, oActivator) >= 11) ||
(GetLevelByClass(CLASS_TYPE_DRUID, oActivator) >= 15))
{
location lPosMarcador = GetCampaignLocation(BD_SPER, "PosMarcador", oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), oActivator);
DelayCommand(1.5, AssignCommand(oActivator, JumpToLocation(lPosMarcador)));
}
else
{
SendMessageToPC(oActivator, "No tienes suficiente nivel para usar este conjuro.");
}
return;
}
if(GetTag(oItem)=="Teletransporte")
{
if (!(GetLevelByClass(CLASS_TYPE_SORCERER, oActivator) >= 1) &&
!(GetLevelByClass(CLASS_TYPE_WIZARD, oActivator) >= 1))
{
location lPosMarcador = GetCampaignLocation(BD_SPER, "PosMarcador", oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), oActivator);
DelayCommand(1.5, AssignCommand(oActivator, JumpToLocation(lPosMarcador)));
DestroyObject(oItem);
return;
}
if ((GetLevelByClass(CLASS_TYPE_SORCERER, oActivator) >= 9) ||
(GetLevelByClass(CLASS_TYPE_WIZARD, oActivator) >= 9))
{
location lPosMarcador = GetCampaignLocation(BD_SPER, "PosMarcador", oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), oActivator);
DelayCommand(1.5, AssignCommand(oActivator, JumpToLocation(lPosMarcador)));
}
else
{
SendMessageToPC(oActivator, "No tienes suficiente nivel para usar este conjuro.");
}
return;
}
if(GetTag(oItem)=="Tasador")
{
SendMessageToPC(oActivator, "Precio base del objeto: "+IntToString(GetGoldPieceValue(oTarget))+" po.");
SendMessageToPC(oActivator, "Nivel del objeto: "+IntToString(CF_ObtenNivelObjeto(oTarget))+".");
return;
}
//Pipa de fumar
if (GetTag(oItem) == "jhr_bp_pipe")
{
SmokePipe(oActivator);
return;
}
//Hostilizador
if(GetTag(oItem) == "Hostilizador")
{
if (GetIsPC(oTarget)) SetPCDislike(oActivator, oTarget);
return;
}
//Bolsa de dados
if (GetTag(oItem) == "sdd_bosadados")
{
AssignCommand(oActivator,ActionStartConversation(oActivator,"sdd_bosadados",TRUE));
return;
}
if(GetTag(oItem) == "Detectarelmal") //Detectar el mal para paladines
{
effect eHead = EffectVisualEffect(VFX_IMP_HEAD_MIND);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eHead,oActivator);
Detect_Evil(oActivator);
return;
}
if(GetTag(oItem) == "cf_guardia") //Guardia de Elite
{
if(GetIsPC(oTarget))
{
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 0, oTarget);
}
return;
}
if(GetTag(oItem)=="PortalallaboratoriodelVado") //Portal para acceder al laboratorio del Vado
{
effect ePortal = EffectVisualEffect(VFX_FNF_LOS_EVIL_10);
DelayCommand(0.1, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePortal, GetLocation(oActivator)));
object oPortal = CreateObject(OBJECT_TYPE_PLACEABLE, "portalvadolab", lLugar);
DestroyObject(oPortal, 15.0);
return;
}
if(GetTag(oItem)=="cf_portsharorrul") //Portal para acceder al laboratorio del Vado
{
effect ePortal = EffectVisualEffect(VFX_FNF_LOS_EVIL_10);
DelayCommand(0.1, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePortal, lLugar));
object oPortal = CreateObject(OBJECT_TYPE_PLACEABLE, "p_sharultr", lLugar);
DestroyObject(oPortal, 15.0);
return;
}
//Rastrear para exploradores.
if(GetTag(oItem)=="cf_rastrear" && GetLevelByClass(CLASS_TYPE_RANGER, oActivator) > 0)
{
ExecuteScript("cf_rastrear", oActivator);
return;
}

if(GetTag(oItem)=="cf_medkit") //Vendas
{
SetLocalObject(oActivator, "ObjetivoVendas", oTarget);
AssignCommand(oActivator,ActionStartConversation(oActivator,"cf_medkit",TRUE));
return;
}
}

void CF_CompContraConjuro(object oPC)
{
string sNombrePC = GetName(oPC);
if(GetActionMode(oPC, ACTION_MODE_COUNTERSPELL)==TRUE) SendMessageToAllDMs(sNombrePC+"esta contraconjurando.");
DelayCommand(1.0, CF_CompContraConjuro(oPC));
}
[/code:1:1de9c47f9b]

Para la libreria habres un script nuevo, pegas eso y lo guardas como rofaerun_inc

Hay lo llevas hay mucho que no te servira espero qu esepas pillar solo lo que te haga falta :P

10/11/2005 10:43:19

Creo que he liberado demasiado codigo del modulo... xD

Ninfablanca

10/11/2005 19:39:00

XDD es una pasada, muchas gracias althor, te devo unas cuantas eh ;)

Mandrake

10/11/2005 19:53:02

Que scripts mas monstruosos... 8O 8O 8O 8O
Imagino que no todos seran para el sistema de muerte :D

Maese Fys

10/11/2005 21:53:13

Anonadado quedado me he o.O

ppmateos

01/07/2010 00:50:37

Podrías volver a poner esos scripts Althor? es que estoy con un sistema de muerte y no me sale la cosa :(