Code: |
#include "ginc_death"
void main() { // Obtention d'amulette des abysses object oPC= GetLastPlayerDied(); CreateItemOnObject("amulettedesabysses",oPC,1); ShowDeathScreen(oPC,TRUE,TRUE,FALSE,TRUE); } void ShowDefaultDeathScreen( object oPlayer ) { //DisplayGuiScreen( oPlayer, GUI_DEFAULT_DEATH_SCREEN, FALSE ); DisplayMessageBox( oPlayer, 0, GetStringByStrRef(181408), "gui_death_respawn", "", FALSE, "", 6603, "", 0, "" ); } |
Code: |
#include "ginc_death"
void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nHD = GetHitDice(oDead); 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)); 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() { RemoveDeathScreens( OBJECT_SELF ); object oRespawner = GetLastRespawnButtonPresser(); AssignCommand(OBJECT_SELF,JumpToObject(GetObjectByTag("NW_DEATH_TEMPLE"))); } |
Code: |
void main() { RemoveDeathScreens( OBJECT_SELF ); object oRespawner = GetLastRespawnButtonPresser(); AssignCommand(OBJECT_SELF,JumpToObject(GetObjectByTag("NW_DEATH_TEMPLE"))); ApplyPenalty(OBJECT_SELF) } |
Code: |
ShowDeathScreen(oPC,TRUE,TRUE,FALSE,TRUE); |
Code: |
ShowDefaultDeathScreen( object oPlayer ) |
Code: |
void ShowDefaultDeathScreen( object oPlayer ) { //DisplayGuiScreen( oPlayer, GUI_DEFAULT_DEATH_SCREEN, FALSE ); DisplayMessageBox( oPlayer, 0, GetStringByStrRef(181408), "gui_death_respawn", "", FALSE, "", 6603, "", 0, "" ); } |
Code: |
object oRespawner = GetLastRespawnButtonPresser(); |
Code: |
#include "ginc_death"
void ApplyPenalty(object oDead); void main() { RemoveDeathScreens( OBJECT_SELF ); ResurrectCreature(OBJECT_SELF); AssignCommand(OBJECT_SELF,JumpToObject(GetObjectByTag("NW_DEATH_TEMPLE"))); ApplyPenalty(OBJECT_SELF); } void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nHD = GetHitDice(oDead); 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)); 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)); } |
Code: |
void ApplyPenalty(object oDead)
{ ....... ....... ....... ....... } void Main { // et rappeler par ici le ApplyPenalty(OBJECT_SELF); } |
Code: |
/* *Procédure appliquant une pénalité d'or et d'experience sur une *créature en fonction de son niveau et Or *Utilisé principalement pour le respawn d'un pj mort *ou comme punition pour un meutre de PNJ */ void ApplyPenalty(object oDead); void main() { RemoveDeathScreens( OBJECT_SELF ); ResurrectCreature(OBJECT_SELF); AssignCommand(OBJECT_SELF,JumpToObject(GetObjectByTag("NW_DEATH_TEMPLE"))); ApplyPenalty(OBJECT_SELF); } void ApplyPenalty(object oDead) { ... } |
Code: |
ApplyPenalty(GetLastKiller()); |