summaryrefslogtreecommitdiff
path: root/npc/001-10
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-08-04 02:33:57 -0300
committerJesusaves <cpntb1@ymail.com>2019-08-04 02:33:57 -0300
commit41b8b307dadcfc99b1c8ad382bf6943be438ed90 (patch)
tree6871602d3303c1042b8c39a1a079b26fe124517f /npc/001-10
parentf92abe203e2c86d998503e6dcfccd7dc92983eb4 (diff)
downloadserverdata-41b8b307dadcfc99b1c8ad382bf6943be438ed90.tar.gz
serverdata-41b8b307dadcfc99b1c8ad382bf6943be438ed90.tar.bz2
serverdata-41b8b307dadcfc99b1c8ad382bf6943be438ed90.tar.xz
serverdata-41b8b307dadcfc99b1c8ad382bf6943be438ed90.zip
COD - Optimize getitem script to avoid crashes
Diffstat (limited to 'npc/001-10')
-rw-r--r--npc/001-10/scripts.txt42
1 files changed, 28 insertions, 14 deletions
diff --git a/npc/001-10/scripts.txt b/npc/001-10/scripts.txt
index f06a6abb8..305b29887 100644
--- a/npc/001-10/scripts.txt
+++ b/npc/001-10/scripts.txt
@@ -72,44 +72,58 @@ OnTouch:
// Death handlers
OnWLDeath:
- if (rand(0,1000) <= 20)
- getitem BottledDust, 1;
+ if (playerattached()) {
+ if (rand2(0,1000) <= 20)
+ getitem BottledDust, 1;
+ }
spawner("#CODMASTER::OnWLDeath", 0, 0, 200, 150, 1, 1);
end;
OnNDeath:
- if (rand(0,1000) <= 40)
- getitem BottledDust, 1;
+ if (playerattached()) {
+ if (rand2(0,1000) <= 40)
+ getitem BottledDust, 1;
+ }
spawner("#CODMASTER::OnNDeath", 0, 10, 200, 25);
end;
OnSDeath:
- if (rand(0,1000) <= 40)
- getitem BottledDust, 1;
+ if (playerattached()) {
+ if (rand2(0,1000) <= 40)
+ getitem BottledDust, 1;
+ }
spawner("#CODMASTER::OnSDeath", 0, 129, 200, 150);
end;
OnCDeath:
- if (rand(0,1000) <= 40)
- getitem BottledDust, 1;
+ if (playerattached()) {
+ if (rand2(0,1000) <= 40)
+ getitem BottledDust, 1;
+ }
spawner("#CODMASTER::OnCDeath", 73, 45, 132, 86);
end;
OnWDeath:
- if (rand(0,1000) <= 40)
- getitem BottledDust, 1;
+ if (playerattached()) {
+ if (rand2(0,1000) <= 40)
+ getitem BottledDust, 1;
+ }
spawner("#CODMASTER::OnWDeath", 10, 25, 72, 122);
end;
OnEDeath:
- if (rand(0,1000) <= 40)
- getitem BottledDust, 1;
+ if (playerattached()) {
+ if (rand2(0,1000) <= 40)
+ getitem BottledDust, 1;
+ }
spawner("#CODMASTER::OnEDeath", 160, 45, 190, 130);
end;
OnDeath:
- if (rand(0,1000) <= 40)
- getitem BottledDust, 1;
+ if (playerattached()) {
+ if (rand2(0,1000) <= 40)
+ getitem BottledDust, 1;
+ }
spawner("#CODMASTER::OnDeath");
end;