Перейти к содержанию

MvP Tomb Stone


Flitemaster

Рекомендуемые сообщения

Добрый день всем, вообщем нашёл я скрипт

http://www.eathena.w...howtopic=279203 Script by ~AnnieRuru~ Filled & Edit by Sanasol

Но к сожалению не смог скачать, при попытке зарегистрироваться.

The error returned was:

The board administrator is no longer accepting any new registrations at the moment.

Если кто может, выложите пожалуйста.

Порылся немного в гугле и смог найти на eAthena - ThaiLand

// ~~~~~ show time left in days, hours, minutes and seconds ~~~~~

function script timeleft__ {

set .@left, getarg(0);

if ( .@left <= 0 ) return getarg(0);

set .@day, .@left / 86400;

set .@hour, .@left % 86400 / 3600;

set .@min, .@left % 3600 / 60;

set .@sec, .@left % 60;

return ( ( .@day )?.@day +" day ":"" )+( ( .@day || .@hour )?.@hour +" hour ":"" )+( ( .@day == 0 && ( .@hour || .@min ) )?.@min +" min ":"" )+( ( .@day || .@hour )?"":.@sec +" sec" );

}

- script tombstone_dup -1,{

getmapxy .@map$, .@x, .@y, 1;

if ( .@x == 0 && .@y == 0 ) end;

set .@id, atoi( strnpcinfo(2) );

mes "Tomb of "+ strmobinfo( 2, .mvpid[.@id] );

mes "it was killed by "+ .name$[.@id];

close;

Onmvpdead:

getmapxy .@map$, .@x, .@y, 0;

set .@id, atoi( strnpcinfo(2) );

set .@map$, strcharinfo(3);

set .name$[.@id], strcharinfo(0);

movenpc strnpcinfo(0), .@x, .@y;

set .@loop, rand(.respawn[0],.respawn[.@id]);

while ( .@loop ) {

delwaitingroom strnpcinfo(0);

waitingroom callfunc("timeleft__", .@loop ), 0;

set .@loop, .@loop -1;

sleep 1000;

}

delwaitingroom strnpcinfo(0);

monster .@map$, 0,0, "--ja--", .mvpid[.@id], 1, strnpcinfo(0) +"::Onmvpdead";

movenpc strnpcinfo(0), 0,0;

end;

OnInit:

if ( strnpcinfo(2) == "" ) {

setarray .respawn[0], 600,7200,43200,10800,5460,7200,25200,18000,7200,7200,7200,7200,7500,3600,7200,3600,28800,28800,28800,28800,5650,3600,7200,7200,7200,7200,7000,3600,3600,7200,28800,3600,7200,3600,18000,39600,7200,3600,3600,7200,3600,7200,7200,7200,7200,43200,7200,10800,18000,10800,21600; // 10 seconds to respawn

setarray .mvpid[1], 1871,1872,1719,1492,1147,1688,1583,2068,2156,2087,2165,1623,1389,1046,1272,1115,1046,1147,1272,1418,1157,2202,1685,1734,1658,1630,1038,1511,1885,1751,1150,1039,1086,1768,1832,1112,1312,1251,2131,1087,1190,1252,1059,1159,1917,1115,1785,1785,1785,1785;

}

else {

sleep 1;

getmapxy .@map$, .@x, .@y, 1;

monster .@map$, 0,0, "--ja--", .mvpid[ atoi( strnpcinfo(2) ) ], 1, strnpcinfo(0) +"::Onmvpdead";

}

end;

}

abbey02,0,0,0 duplicate(tombstone_dup) Tomb#1_mvp 565

abbey03,0,0,0 duplicate(tombstone_dup) Tomb#2_mvp 565

abyss_03,0,0,0 duplicate(tombstone_dup) Tomb#3_mvp 565

ama_dun03,0,0,0 duplicate(tombstone_dup) Tomb#4_mvp 565

anthell02,0,0,0 duplicate(tombstone_dup) Tomb#5_mvp 565

ayo_dun02,0,0,0 duplicate(tombstone_dup) Tomb#6_mvp 565

beach_dun,0,0,0 duplicate(tombstone_dup) Tomb#7_mvp 565

bra_dun02,0,0,0 duplicate(tombstone_dup) Tomb#8_mvp 565

dew_dun01,0,0,0 duplicate(tombstone_dup) Tomb#9_mvp 565

dic_dun02,0,0,0 duplicate(tombstone_dup) Tomb#10_mvp 565

dic_dun03,0,0,0 duplicate(tombstone_dup) Tomb#11_mvp 565

ein_dun02,0,0,0 duplicate(tombstone_dup) Tomb#12_mvp 565

gef_dun01,0,0,0 duplicate(tombstone_dup) Tomb#13_mvp 565

gef_dun02,0,0,0 duplicate(tombstone_dup) Tomb#14_mvp 565

gl_chyard,0,0,0 duplicate(tombstone_dup) Tomb#15_mvp 565

gld_dun01,0,0,0 duplicate(tombstone_dup) Tomb#16_mvp 565

gld_dun02,0,0,0 duplicate(tombstone_dup) Tomb#17_mvp 565

gld_dun03,0,0,0 duplicate(tombstone_dup) Tomb#18_mvp 565

gld_dun04,0,0,0 duplicate(tombstone_dup) Tomb#19_mvp 565

gon_dun03,0,0,0 duplicate(tombstone_dup) Tomb#20_mvp 565

in_sphinx5,0,0,0 duplicate(tombstone_dup) Tomb#21_mvp 565

iz_dun05,0,0,0 duplicate(tombstone_dup) Tomb#22_mvp 565

jupe_core,0,0,0 duplicate(tombstone_dup) Tomb#23_mvp 565

kh_dun02,0,0,0 duplicate(tombstone_dup) Tomb#24_mvp 565

lhz_dun02,0,0,0 duplicate(tombstone_dup) Tomb#25_mvp 565

lou_dun03,0,0,0 duplicate(tombstone_dup) Tomb#26_mvp 565

moc_pryd04,0,0,0 duplicate(tombstone_dup) Tomb#27_mvp 565

moc_pryd06,0,0,0 duplicate(tombstone_dup) Tomb#28_mvp 565

mosk_dun03,0,0,0 duplicate(tombstone_dup) Tomb#29_mvp 565

odin_tem03,0,0,0 duplicate(tombstone_dup) Tomb#30_mvp 565

pay_dun04,0,0,0 duplicate(tombstone_dup) Tomb#31_mvp 565

prt_maze03,0,0,0 duplicate(tombstone_dup) Tomb#32_mvp 565

prt_sewb4,0,0,0 duplicate(tombstone_dup) Tomb#33_mvp 565

ra_san05,0,0,0 duplicate(tombstone_dup) Tomb#34_mvp 565

thor_v03,0,0,0 duplicate(tombstone_dup) Tomb#35_mvp 565

treasure02,0,0,0 duplicate(tombstone_dup) Tomb#36_mvp 565

tur_dun04,0,0,0 duplicate(tombstone_dup) Tomb#37_mvp 565

xmas_dun02,0,0,0 duplicate(tombstone_dup) Tomb#38_mvp 565

1@mist,0,0,0 duplicate(tombstone_dup) Tomb#39_mvp 565

gef_fild03,0,0,0 duplicate(tombstone_dup) Tomb#40_mvp 565

gef_fild10,0,0,0 duplicate(tombstone_dup) Tomb#41_mvp 565

xmas_fild01,0,0,0 duplicate(tombstone_dup) Tomb#42_mvp 565

mjolnir_04,0,0,0 duplicate(tombstone_dup) Tomb#43_mvp 565

moc_fild17,0,0,0 duplicate(tombstone_dup) Tomb#44_mvp 565

moc_fild22,0,0,0 duplicate(tombstone_dup) Tomb#45_mvp 565

pay_fild10,0,0,0 duplicate(tombstone_dup) Tomb#46_mvp 565

ra_fild03,0,0,0 duplicate(tombstone_dup) Tomb#47_mvp 565

ra_fild04,0,0,0 duplicate(tombstone_dup) Tomb#48_mvp 565

ve_fild01,0,0,0 duplicate(tombstone_dup) Tomb#49_mvp 565

ve_fild02,0,0,0 duplicate(tombstone_dup) Tomb#50_mvp 565

Ошибки не выбивает, но томб после убийства не появился, вчём может быть проблема?

Изменено пользователем Flitemaster
Ссылка на комментарий
Поделиться на другие сайты


// ~~~~~ show time left in days, hours, minutes and seconds ~~~~~
function script timeleft__ {
set .@left, getarg(0);
if ( .@left <= 0 ) return getarg(0);
set .@day, .@left / 86400;
set .@hour, .@left % 86400 / 3600;
set .@min, .@left % 3600 / 60;
set .@sec, .@left % 60;
return ( ( .@day )?.@day +" day ":"" )+( ( .@day || .@hour )?.@hour +" hour ":"" )+( ( .@day == 0 && ( .@hour || .@min ) )?.@min +" min ":"" )+( ( .@day || .@hour )?"":.@sec +" sec" );
}
- script tombstone_dup -1,{
getmapxy .@map$, .@x, .@y, 1;
if ( .@x == 0 && .@y == 0 ) end;
set .@id, atoi( strnpcinfo(2) );
mes "Tomb of "+ strmobinfo( 2, .mvpid[.@id] );
mes "it was killed by "+ .name$[.@id];
close;
Onmvpdead:
getmapxy .@map$, .@x, .@y, 0;
set .@id, atoi( strnpcinfo(2) );
set .@map$, strcharinfo(3);
set .name$[.@id], strcharinfo(0);
movenpc strnpcinfo(0), .@x, .@y;
set .@loop, rand(.respawn[0],.respawn[.@id]);
while ( .@loop ) {
delwaitingroom strnpcinfo(0);
waitingroom callfunc("timeleft__", .@loop ), 0;
set .@loop, .@loop -1;
sleep 1000;
}
delwaitingroom strnpcinfo(0);
monster .@map$, 0,0, "--ja--", .mvpid[.@id], 1, strnpcinfo(0) +"::Onmvpdead";
movenpc strnpcinfo(0), 0,0;
end;
OnInit:
if ( strnpcinfo(2) == "" ) {
setarray .respawn[0], 600,7200,43200,10800,5460,7200,25200,18000,7200,7200,7200,7200,7500,3600,7200,3600,28800,28800,28800,28800,5650,3600,7200,7200,7200,7200,7000,3600,3600,7200,28800,3600,7200,3600,18000,39600,7200,3600,3600,7200,3600,7200,7200,7200,7200,43200,7200,10800,18000,10800,21600; // 10 seconds to respawn
setarray .mvpid[1], 1871,1872,1719,1492,1147,1688,1583,2068,2156,2087,2165,1623,1389,1046,1272,1115,1046,1147,1272,1418,1157,2202,1685,1734,1658,1630,1038,1511,1885,1751,1150,1039,1086,1768,1832,1112,1312,1251,2131,1087,1190,1252,1059,1159,1917,1115,1785,1785,1785,1785;
}
else {
sleep 1;
getmapxy .@map$, .@x, .@y, 1;
monster .@map$, 0,0, "--ja--", .mvpid[ atoi( strnpcinfo(2) ) ], 1, strnpcinfo(0) +"::Onmvpdead";
}
end;
}

abbey02,0,0,0 duplicate(tombstone_dup) Tomb#1_mvp 565
abbey03,0,0,0 duplicate(tombstone_dup) Tomb#2_mvp 565
abyss_03,0,0,0 duplicate(tombstone_dup) Tomb#3_mvp 565
ama_dun03,0,0,0 duplicate(tombstone_dup) Tomb#4_mvp 565
anthell02,0,0,0 duplicate(tombstone_dup) Tomb#5_mvp 565
ayo_dun02,0,0,0 duplicate(tombstone_dup) Tomb#6_mvp 565
beach_dun,0,0,0 duplicate(tombstone_dup) Tomb#7_mvp 565
bra_dun02,0,0,0 duplicate(tombstone_dup) Tomb#8_mvp 565
dew_dun01,0,0,0 duplicate(tombstone_dup) Tomb#9_mvp 565
dic_dun02,0,0,0 duplicate(tombstone_dup) Tomb#10_mvp 565
dic_dun03,0,0,0 duplicate(tombstone_dup) Tomb#11_mvp 565
ein_dun02,0,0,0 duplicate(tombstone_dup) Tomb#12_mvp 565
gef_dun01,0,0,0 duplicate(tombstone_dup) Tomb#13_mvp 565
gef_dun02,0,0,0 duplicate(tombstone_dup) Tomb#14_mvp 565
gl_chyard,0,0,0 duplicate(tombstone_dup) Tomb#15_mvp 565
gld_dun01,0,0,0 duplicate(tombstone_dup) Tomb#16_mvp 565
gld_dun02,0,0,0 duplicate(tombstone_dup) Tomb#17_mvp 565
gld_dun03,0,0,0 duplicate(tombstone_dup) Tomb#18_mvp 565
gld_dun04,0,0,0 duplicate(tombstone_dup) Tomb#19_mvp 565
gon_dun03,0,0,0 duplicate(tombstone_dup) Tomb#20_mvp 565
in_sphinx5,0,0,0 duplicate(tombstone_dup) Tomb#21_mvp 565
iz_dun05,0,0,0 duplicate(tombstone_dup) Tomb#22_mvp 565
jupe_core,0,0,0 duplicate(tombstone_dup) Tomb#23_mvp 565
kh_dun02,0,0,0 duplicate(tombstone_dup) Tomb#24_mvp 565
lhz_dun02,0,0,0 duplicate(tombstone_dup) Tomb#25_mvp 565
lou_dun03,0,0,0 duplicate(tombstone_dup) Tomb#26_mvp 565
moc_pryd04,0,0,0 duplicate(tombstone_dup) Tomb#27_mvp 565
moc_pryd06,0,0,0 duplicate(tombstone_dup) Tomb#28_mvp 565
mosk_dun03,0,0,0 duplicate(tombstone_dup) Tomb#29_mvp 565
odin_tem03,0,0,0 duplicate(tombstone_dup) Tomb#30_mvp 565
pay_dun04,0,0,0 duplicate(tombstone_dup) Tomb#31_mvp 565
prt_maze03,0,0,0 duplicate(tombstone_dup) Tomb#32_mvp 565
prt_sewb4,0,0,0 duplicate(tombstone_dup) Tomb#33_mvp 565
ra_san05,0,0,0 duplicate(tombstone_dup) Tomb#34_mvp 565
thor_v03,0,0,0 duplicate(tombstone_dup) Tomb#35_mvp 565
treasure02,0,0,0 duplicate(tombstone_dup) Tomb#36_mvp 565
tur_dun04,0,0,0 duplicate(tombstone_dup) Tomb#37_mvp 565
xmas_dun02,0,0,0 duplicate(tombstone_dup) Tomb#38_mvp 565
1@mist,0,0,0 duplicate(tombstone_dup) Tomb#39_mvp 565
gef_fild03,0,0,0 duplicate(tombstone_dup) Tomb#40_mvp 565
gef_fild10,0,0,0 duplicate(tombstone_dup) Tomb#41_mvp 565
xmas_fild01,0,0,0 duplicate(tombstone_dup) Tomb#42_mvp 565
mjolnir_04,0,0,0 duplicate(tombstone_dup) Tomb#43_mvp 565
moc_fild17,0,0,0 duplicate(tombstone_dup) Tomb#44_mvp 565
moc_fild22,0,0,0 duplicate(tombstone_dup) Tomb#45_mvp 565
pay_fild10,0,0,0 duplicate(tombstone_dup) Tomb#46_mvp 565
ra_fild03,0,0,0 duplicate(tombstone_dup) Tomb#47_mvp 565
ra_fild04,0,0,0 duplicate(tombstone_dup) Tomb#48_mvp 565
ve_fild01,0,0,0 duplicate(tombstone_dup) Tomb#49_mvp 565
ve_fild02,0,0,0 duplicate(tombstone_dup) Tomb#50_mvp 565

В РА вроде уже встроен

http://rathena.org/b...-added-features

ps. Ошибка в том, что в твоей версии нет лейбла onmvpdead?

Изменено пользователем botka4aet
  • Upvote 1
Ссылка на комментарий
Поделиться на другие сайты


// ~~~~~ show time left in days, hours, minutes and seconds ~~~~~
function script timeleft__ {
set .@left, getarg(0);
if ( .@left <= 0 ) return getarg(0);
set .@day, .@left / 86400;
set .@hour, .@left % 86400 / 3600;
set .@min, .@left % 3600 / 60;
set .@sec, .@left % 60;
return ( ( .@day )?.@day +" day ":"" )+( ( .@day || .@hour )?.@hour +" hour ":"" )+( ( .@day == 0 && ( .@hour || .@min ) )?.@min +" min ":"" )+( ( .@day || .@hour )?"":.@sec +" sec" );
}
- script tombstone_dup -1,{
getmapxy .@map$, .@x, .@y, 1;
if ( .@x == 0 && .@y == 0 ) end;
set .@id, atoi( strnpcinfo(2) );
mes "Tomb of "+ strmobinfo( 2, .mvpid[.@id] );
mes "it was killed by "+ .name$[.@id];
close;
Onmvpdead:
getmapxy .@map$, .@x, .@y, 0;
set .@id, atoi( strnpcinfo(2) );
set .@map$, strcharinfo(3);
set .name$[.@id], strcharinfo(0);
movenpc strnpcinfo(0), .@x, .@y;
set .@loop, rand(.respawn[0],.respawn[.@id]);
while ( .@loop ) {
delwaitingroom strnpcinfo(0);
waitingroom callfunc("timeleft__", .@loop ), 0;
set .@loop, .@loop -1;
sleep 1000;
}
delwaitingroom strnpcinfo(0);
monster .@map$, 0,0, "--ja--", .mvpid[.@id], 1, strnpcinfo(0) +"::Onmvpdead";
movenpc strnpcinfo(0), 0,0;
end;
OnInit:
if ( strnpcinfo(2) == "" ) {
setarray .respawn[0], 600,7200,43200,10800,5460,7200,25200,18000,7200,7200,7200,7200,7500,3600,7200,3600,28800,28800,28800,28800,5650,3600,7200,7200,7200,7200,7000,3600,3600,7200,28800,3600,7200,3600,18000,39600,7200,3600,3600,7200,3600,7200,7200,7200,7200,43200,7200,10800,18000,10800,21600; // 10 seconds to respawn
setarray .mvpid[1], 1871,1872,1719,1492,1147,1688,1583,2068,2156,2087,2165,1623,1389,1046,1272,1115,1046,1147,1272,1418,1157,2202,1685,1734,1658,1630,1038,1511,1885,1751,1150,1039,1086,1768,1832,1112,1312,1251,2131,1087,1190,1252,1059,1159,1917,1115,1785,1785,1785,1785;
}
else {
sleep 1;
getmapxy .@map$, .@x, .@y, 1;
monster .@map$, 0,0, "--ja--", .mvpid[ atoi( strnpcinfo(2) ) ], 1, strnpcinfo(0) +"::Onmvpdead";
}
end;
}

abbey02,0,0,0 duplicate(tombstone_dup) Tomb#1_mvp 565
abbey03,0,0,0 duplicate(tombstone_dup) Tomb#2_mvp 565
abyss_03,0,0,0 duplicate(tombstone_dup) Tomb#3_mvp 565
ama_dun03,0,0,0 duplicate(tombstone_dup) Tomb#4_mvp 565
anthell02,0,0,0 duplicate(tombstone_dup) Tomb#5_mvp 565
ayo_dun02,0,0,0 duplicate(tombstone_dup) Tomb#6_mvp 565
beach_dun,0,0,0 duplicate(tombstone_dup) Tomb#7_mvp 565
bra_dun02,0,0,0 duplicate(tombstone_dup) Tomb#8_mvp 565
dew_dun01,0,0,0 duplicate(tombstone_dup) Tomb#9_mvp 565
dic_dun02,0,0,0 duplicate(tombstone_dup) Tomb#10_mvp 565
dic_dun03,0,0,0 duplicate(tombstone_dup) Tomb#11_mvp 565
ein_dun02,0,0,0 duplicate(tombstone_dup) Tomb#12_mvp 565
gef_dun01,0,0,0 duplicate(tombstone_dup) Tomb#13_mvp 565
gef_dun02,0,0,0 duplicate(tombstone_dup) Tomb#14_mvp 565
gl_chyard,0,0,0 duplicate(tombstone_dup) Tomb#15_mvp 565
gld_dun01,0,0,0 duplicate(tombstone_dup) Tomb#16_mvp 565
gld_dun02,0,0,0 duplicate(tombstone_dup) Tomb#17_mvp 565
gld_dun03,0,0,0 duplicate(tombstone_dup) Tomb#18_mvp 565
gld_dun04,0,0,0 duplicate(tombstone_dup) Tomb#19_mvp 565
gon_dun03,0,0,0 duplicate(tombstone_dup) Tomb#20_mvp 565
in_sphinx5,0,0,0 duplicate(tombstone_dup) Tomb#21_mvp 565
iz_dun05,0,0,0 duplicate(tombstone_dup) Tomb#22_mvp 565
jupe_core,0,0,0 duplicate(tombstone_dup) Tomb#23_mvp 565
kh_dun02,0,0,0 duplicate(tombstone_dup) Tomb#24_mvp 565
lhz_dun02,0,0,0 duplicate(tombstone_dup) Tomb#25_mvp 565
lou_dun03,0,0,0 duplicate(tombstone_dup) Tomb#26_mvp 565
moc_pryd04,0,0,0 duplicate(tombstone_dup) Tomb#27_mvp 565
moc_pryd06,0,0,0 duplicate(tombstone_dup) Tomb#28_mvp 565
mosk_dun03,0,0,0 duplicate(tombstone_dup) Tomb#29_mvp 565
odin_tem03,0,0,0 duplicate(tombstone_dup) Tomb#30_mvp 565
pay_dun04,0,0,0 duplicate(tombstone_dup) Tomb#31_mvp 565
prt_maze03,0,0,0 duplicate(tombstone_dup) Tomb#32_mvp 565
prt_sewb4,0,0,0 duplicate(tombstone_dup) Tomb#33_mvp 565
ra_san05,0,0,0 duplicate(tombstone_dup) Tomb#34_mvp 565
thor_v03,0,0,0 duplicate(tombstone_dup) Tomb#35_mvp 565
treasure02,0,0,0 duplicate(tombstone_dup) Tomb#36_mvp 565
tur_dun04,0,0,0 duplicate(tombstone_dup) Tomb#37_mvp 565
xmas_dun02,0,0,0 duplicate(tombstone_dup) Tomb#38_mvp 565
1@mist,0,0,0 duplicate(tombstone_dup) Tomb#39_mvp 565
gef_fild03,0,0,0 duplicate(tombstone_dup) Tomb#40_mvp 565
gef_fild10,0,0,0 duplicate(tombstone_dup) Tomb#41_mvp 565
xmas_fild01,0,0,0 duplicate(tombstone_dup) Tomb#42_mvp 565
mjolnir_04,0,0,0 duplicate(tombstone_dup) Tomb#43_mvp 565
moc_fild17,0,0,0 duplicate(tombstone_dup) Tomb#44_mvp 565
moc_fild22,0,0,0 duplicate(tombstone_dup) Tomb#45_mvp 565
pay_fild10,0,0,0 duplicate(tombstone_dup) Tomb#46_mvp 565
ra_fild03,0,0,0 duplicate(tombstone_dup) Tomb#47_mvp 565
ra_fild04,0,0,0 duplicate(tombstone_dup) Tomb#48_mvp 565
ve_fild01,0,0,0 duplicate(tombstone_dup) Tomb#49_mvp 565
ve_fild02,0,0,0 duplicate(tombstone_dup) Tomb#50_mvp 565

В РА вроде уже встроен

http://rathena.org/b...-added-features

Спасибо, да в РА встроен, но мне для еа нужно :)

Ссылка на комментарий
Поделиться на другие сайты

По ссылке есть для еа 15090


Index: conf/battle/monster.conf
===================================================================
--- conf/battle/monster.conf (revision 15090)
+++ conf/battle/monster.conf (working copy)
@@ -213,3 +213,7 @@

// Should MVP slaves retain their target when summoned back to their master?
mob_slave_keep_target: yes
+
+// Wheter or not to spawn the mvp tomb.
+// See http://irowiki.org/wiki/MVP#Gravestone
+mvp_tomb_enabled: yes
\ No newline at end of file
Index: conf/msg_athena.conf
===================================================================
--- conf/msg_athena.conf (revision 15090)
+++ conf/msg_athena.conf (working copy)
@@ -535,5 +535,17 @@
//...
650: Unknown Job

+// MvP Tomb
+// Added here so it can be easily translated
+656: Tomb
+657: [ ^EE0000%s^000000 ]
+658: Has met its demise
+659: Time of death : ^EE0000%s^000000
+660: Defeated by
+661: [^EE0000%s^000000]
+// Added features [malufett]
+900: Time of respawn: ^EE0000%s^000000
+901: Time left: %02i:%02i:%02i
+
//Custom translations
import: conf/import/msg_conf.txt
Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 15090)
+++ src/map/battle.c (working copy)
@@ -4023,6 +4023,7 @@
{ "bg_magic_attack_damage_rate", &battle_config.bg_magic_damage_rate, 60, 0, INT_MAX, },
{ "bg_misc_attack_damage_rate", &battle_config.bg_misc_damage_rate, 60, 0, INT_MAX, },
{ "bg_flee_penalty", &battle_config.bg_flee_penalty, 20, 0, INT_MAX, },
+ { "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1, },
};


Index: src/map/battle.h
===================================================================
--- src/map/battle.h (revision 15090)
+++ src/map/battle.h (working copy)
@@ -497,6 +497,8 @@
int bg_magic_damage_rate;
int bg_misc_damage_rate;
int bg_flee_penalty;
+
+ int mvp_tomb_enabled;
} battle_config;

void do_init_battle(void);
Index: src/map/map.h
===================================================================
--- src/map/map.h (revision 15090)
+++ src/map/map.h (working copy)
@@ -199,7 +199,7 @@
//For common mapforeach calls. Since pets cannot be affected, they aren't included here yet.
#define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER)

-enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP };
+enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP, TOMB };

enum {
RC_FORMLESS=0,
Index: src/map/mob.c
===================================================================
--- src/map/mob.c (revision 15090)
+++ src/map/mob.c (working copy)
@@ -33,6 +33,7 @@
#include "atcommand.h"
#include "date.h"
#include "quest.h"
+#include "chat.h"

#include <stdio.h>
#include <stdlib.h>
@@ -115,6 +116,88 @@
}

/*==========================================
+ * MvP Tomb [GreenBox]
+ *------------------------------------------*/
+void mvptomb_create(struct mob_data *md, char *killer, time_t time)
+{
+ struct npc_data *nd;
+ const struct TimerData * timer_data = get_timer(md->spawn_timer);
+
+ CREATE(nd, struct npc_data, 1);
+
+ nd->bl.id = md->tomb_nid = npc_get_new_npc_id();
+
+ nd->ud.dir = md->ud.dir;
+ nd->bl.m = md->bl.m;
+ nd->bl.x = md->bl.x;
+ nd->bl.y = md->bl.y;
+ nd->bl.type = BL_NPC;
+
+ safestrncpy(nd->name, msg_txt(656), sizeof(nd->name));
+
+ nd->class_ = 565;
+ nd->speed = 200;
+ nd->subtype = TOMB;
+
+ nd->u.tomb.md = md;
+ nd->u.tomb.kill_time = time;
+ nd->u.tomb.spawn_time = nd->u.tomb.spawn_timer = (DIFF_TICK(timer_data->tick, gettick()) + 60);
+
+ if (killer)
+ safestrncpy(nd->u.tomb.killer_name, killer, NAME_LENGTH);
+ else
+ nd->u.tomb.killer_name[0] = '\0';
+
+ map_addnpc(nd->bl.m, nd);
+ map_addblock(&nd->bl);
+ status_set_viewdata(&nd->bl, nd->class_);
+ status_change_init(&nd->bl);
+ unit_dataset(&nd->bl);
+ clif_spawn(&nd->bl);
+
+ add_timer(gettick()+1000, mob_tombtimer, nd->bl.id, 0);
+}
+
+/**
+ MVP Tomb Added Features
+ -Show time left before respawning [malufett]
+**/
+int mob_tombtimer(int tid, unsigned int tick, int id, intptr_t data)
+{
+ struct npc_data *nd = (struct npc_data *)map_id2bl(id);
+ int ms = nd->u.tomb.spawn_timer, hour=0, min=0, sec=0;
+
+ if( nd && ms > 0)
+ {
+ char w1[256];
+
+ hour = ms / 3600000;
+ min = ms % 3600000 / 60000;
+ sec = ms % 60000 / 1000;
+
+ sprintf(w1, msg_txt(901), hour , min, sec);
+
+ chat_deletenpcchat(nd);
+ chat_createnpcchat(nd, w1, 0, 0, 1, "", 0, 1, MAX_LEVEL);
+
+ add_timer(gettick()+1000, mob_tombtimer, id, 0);
+ nd->u.tomb.spawn_timer -= 1000;
+ }else
+ chat_deletenpcchat(nd);
+
+ return 0;
+}
+
+void mvptomb_destroy(struct mob_data *md)
+{
+ struct npc_data *nd = (struct npc_data *)map_id2bl(md->tomb_nid);
+ if (nd)
+ npc_unload(nd);
+
+ md->tomb_nid = 0;
+}
+
+/*==========================================
* Founds up to N matches. Returns number of matches [Skotlex]
*------------------------------------------*/
int mobdb_searchname_array(struct mob_db** data, int size, const char *str)
@@ -804,6 +887,13 @@
if( md->spawn_timer != INVALID_TIMER )
delete_timer(md->spawn_timer, mob_delayspawn);
md->spawn_timer = add_timer(gettick()+spawntime, mob_delayspawn, md->bl.id, 0);
+
+ // MvP tomb [GreenBox]
+ if (battle_config.mvp_tomb_enabled && md->spawn->state.boss){
+ struct map_session_data *mvp_sd = map_id2sd(md->target_id);
+ mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
+ }
+
return 0;
}

@@ -890,6 +980,10 @@
// Added for carts, falcons and pecos for cloned monsters. [Valaris]
md->sc.option = md->db->option;

+ // MvP tomb [GreenBox]
+ if (md->tomb_nid)
+ mvptomb_destroy(md);
+
map_addblock(&md->bl);
clif_spawn(&md->bl);
skill_unit_move(&md->bl,tick,1);
@@ -2446,6 +2540,9 @@
if(!md->spawn) //Tell status_damage to remove it from memory.
return 5; // Note: Actually, it's 4. Oh well...

+ if (battle_config.mvp_tomb_enabled && md->spawn->state.boss)
+ md->target_id = mvp_sd->bl.id;
+
if( !rebirth )
mob_setdelayspawn(md); //Set respawning.
return 3; //Remove from map.
@@ -4334,6 +4431,8 @@
add_timer_interval(gettick()+MIN_MOBTHINKTIME,mob_ai_hard,0,0,MIN_MOBTHINKTIME);
add_timer_interval(gettick()+MIN_MOBTHINKTIME*10,mob_ai_lazy,0,0,MIN_MOBTHINKTIME*10);

+ add_timer_func_list(mob_tombtimer,"mob_tombtimer");// [malufett]
+
return 0;
}

@@ -4367,4 +4466,4 @@
ers_destroy(item_drop_ers);
ers_destroy(item_drop_list_ers);
return 0;
-}
+}
\ No newline at end of file
Index: src/map/mob.h
===================================================================
--- src/map/mob.h (revision 15090)
+++ src/map/mob.h (working copy)
@@ -161,6 +161,8 @@
short skillidx;
unsigned int skilldelay[MAX_MOBSKILL];
char npc_event[EVENT_NAME_LENGTH];
+
+ int tomb_nid;
};


@@ -277,6 +279,11 @@
int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char *event, int master_id, int mode, int flag, unsigned int duration);
int mob_clone_delete(struct mob_data *md);

+// MvP Tomb System
+void mvptomb_create(struct mob_data *md, char *killer, time_t time);
+void mvptomb_destroy(struct mob_data *md);
+int mob_tombtimer(int tid, unsigned int tick, int id, intptr_t data);
+
void mob_reload(void);

#endif /* _MOB_H_ */
Index: src/map/npc.c
===================================================================
--- src/map/npc.c (revision 15090)
+++ src/map/npc.c (working copy)
@@ -27,6 +27,7 @@
#include "unit.h"
#include "npc.h"
#include "chat.h"
+#include "atcommand.h"

#include <stdio.h>
#include <stdlib.h>
@@ -1087,6 +1088,8 @@
case SCRIPT:
run_script(nd->u.scr.script,0,sd->bl.id,nd->bl.id);
break;
+ case TOMB:
+ run_tomb(sd,nd);
}

return 0;
@@ -2634,6 +2637,48 @@
clif_spawn(&nd->bl);// fade in
}

+// MvP tomb [GreenBox]
+void run_tomb(struct map_session_data* sd, struct npc_data* nd)
+{
+ char buffer[200];
+ char time[10];
+ struct tm *newtime = localtime(&nd->u.tomb.kill_time);
+
+ strftime(time, sizeof(time), "%H:%M", newtime);
+
+ // TODO: Find exact color?
+ snprintf(buffer, sizeof(buffer), msg_txt(657), nd->u.tomb.md->db->name);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ clif_scriptmes(sd, nd->bl.id, msg_txt(658));
+
+ snprintf(buffer, sizeof(buffer), msg_txt(659), time);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ /** MVP Tomb added features
+ -Show time of respawn [malufett]
+ **/
+ if(nd->u.tomb.spawn_time != INVALID_TIMER){
+ int ms = nd->u.tomb.spawn_time;
+ newtime->tm_hour += ms % 86400000 / 3600000;
+ newtime->tm_min += ms % 3600000 / 60000 + 1;
+ if(newtime->tm_min>59){
+ newtime->tm_hour++;
+ newtime->tm_min -= 60;
+ }
+ strftime(time, sizeof(time), "%H:%M", newtime);
+ snprintf(buffer, sizeof(buffer), msg_txt(900), time);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+ }
+
+ clif_scriptmes(sd, nd->bl.id, msg_txt(660));
+
+ snprintf(buffer, sizeof(buffer), msg_txt(661), nd->u.tomb.killer_name[0] ? nd->u.tomb.killer_name : "Unknown");
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ clif_scriptclose(sd, nd->bl.id);
+}
+
/// Parses a function.
/// function%TAB%script%TAB%<function name>%TAB%{<code>}
static const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath)
Index: src/map/npc.h
===================================================================
--- src/map/npc.h (revision 15090)
+++ src/map/npc.h (working copy)
@@ -62,6 +62,13 @@
short x,y; // destination coords
unsigned short mapindex; // destination map
} warp;
+ struct {
+ struct mob_data *md;
+ time_t kill_time;
+ char killer_name[NAME_LENGTH];
+ int spawn_time; //malufett
+ int spawn_timer;
+ } tomb;
} u;
};

@@ -155,6 +162,8 @@
int npc_duplicate4instance(struct npc_data *snd, int m);
int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int points);

+void run_tomb(struct map_session_data* sd, struct npc_data* nd);
+
extern struct npc_data* fake_nd;

#endif /* _NPC_H_ */
Index: src/map/unit.c
===================================================================
--- src/map/unit.c (revision 15090)
+++ src/map/unit.c (working copy)
@@ -2215,6 +2215,9 @@
}
if( mob_is_clone(md->class_) )
mob_clone_delete(md);
+ if( md->tomb_nid )
+ mvptomb_destroy(md);
+
break;
}
case BL_HOM:

  • Upvote 1
Ссылка на комментарий
Поделиться на другие сайты

По ссылке есть для еа 15090


Index: conf/battle/monster.conf
===================================================================
--- conf/battle/monster.conf (revision 15090)
+++ conf/battle/monster.conf (working copy)
@@ -213,3 +213,7 @@

// Should MVP slaves retain their target when summoned back to their master?
mob_slave_keep_target: yes
+
+// Wheter or not to spawn the mvp tomb.
+// See http://irowiki.org/wiki/MVP#Gravestone
+mvp_tomb_enabled: yes
\ No newline at end of file
Index: conf/msg_athena.conf
===================================================================
--- conf/msg_athena.conf (revision 15090)
+++ conf/msg_athena.conf (working copy)
@@ -535,5 +535,17 @@
//...
650: Unknown Job

+// MvP Tomb
+// Added here so it can be easily translated
+656: Tomb
+657: [ ^EE0000%s^000000 ]
+658: Has met its demise
+659: Time of death : ^EE0000%s^000000
+660: Defeated by
+661: [^EE0000%s^000000]
+// Added features [malufett]
+900: Time of respawn: ^EE0000%s^000000
+901: Time left: %02i:%02i:%02i
+
//Custom translations
import: conf/import/msg_conf.txt
Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 15090)
+++ src/map/battle.c (working copy)
@@ -4023,6 +4023,7 @@
{ "bg_magic_attack_damage_rate", &battle_config.bg_magic_damage_rate, 60, 0, INT_MAX, },
{ "bg_misc_attack_damage_rate", &battle_config.bg_misc_damage_rate, 60, 0, INT_MAX, },
{ "bg_flee_penalty", &battle_config.bg_flee_penalty, 20, 0, INT_MAX, },
+ { "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1, },
};


Index: src/map/battle.h
===================================================================
--- src/map/battle.h (revision 15090)
+++ src/map/battle.h (working copy)
@@ -497,6 +497,8 @@
int bg_magic_damage_rate;
int bg_misc_damage_rate;
int bg_flee_penalty;
+
+ int mvp_tomb_enabled;
} battle_config;

void do_init_battle(void);
Index: src/map/map.h
===================================================================
--- src/map/map.h (revision 15090)
+++ src/map/map.h (working copy)
@@ -199,7 +199,7 @@
//For common mapforeach calls. Since pets cannot be affected, they aren't included here yet.
#define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER)

-enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP };
+enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP, TOMB };

enum {
RC_FORMLESS=0,
Index: src/map/mob.c
===================================================================
--- src/map/mob.c (revision 15090)
+++ src/map/mob.c (working copy)
@@ -33,6 +33,7 @@
#include "atcommand.h"
#include "date.h"
#include "quest.h"
+#include "chat.h"

#include <stdio.h>
#include <stdlib.h>
@@ -115,6 +116,88 @@
}

/*==========================================
+ * MvP Tomb [GreenBox]
+ *------------------------------------------*/
+void mvptomb_create(struct mob_data *md, char *killer, time_t time)
+{
+ struct npc_data *nd;
+ const struct TimerData * timer_data = get_timer(md->spawn_timer);
+
+ CREATE(nd, struct npc_data, 1);
+
+ nd->bl.id = md->tomb_nid = npc_get_new_npc_id();
+
+ nd->ud.dir = md->ud.dir;
+ nd->bl.m = md->bl.m;
+ nd->bl.x = md->bl.x;
+ nd->bl.y = md->bl.y;
+ nd->bl.type = BL_NPC;
+
+ safestrncpy(nd->name, msg_txt(656), sizeof(nd->name));
+
+ nd->class_ = 565;
+ nd->speed = 200;
+ nd->subtype = TOMB;
+
+ nd->u.tomb.md = md;
+ nd->u.tomb.kill_time = time;
+ nd->u.tomb.spawn_time = nd->u.tomb.spawn_timer = (DIFF_TICK(timer_data->tick, gettick()) + 60);
+
+ if (killer)
+ safestrncpy(nd->u.tomb.killer_name, killer, NAME_LENGTH);
+ else
+ nd->u.tomb.killer_name[0] = '\0';
+
+ map_addnpc(nd->bl.m, nd);
+ map_addblock(&nd->bl);
+ status_set_viewdata(&nd->bl, nd->class_);
+ status_change_init(&nd->bl);
+ unit_dataset(&nd->bl);
+ clif_spawn(&nd->bl);
+
+ add_timer(gettick()+1000, mob_tombtimer, nd->bl.id, 0);
+}
+
+/**
+ MVP Tomb Added Features
+ -Show time left before respawning [malufett]
+**/
+int mob_tombtimer(int tid, unsigned int tick, int id, intptr_t data)
+{
+ struct npc_data *nd = (struct npc_data *)map_id2bl(id);
+ int ms = nd->u.tomb.spawn_timer, hour=0, min=0, sec=0;
+
+ if( nd && ms > 0)
+ {
+ char w1[256];
+
+ hour = ms / 3600000;
+ min = ms % 3600000 / 60000;
+ sec = ms % 60000 / 1000;
+
+ sprintf(w1, msg_txt(901), hour , min, sec);
+
+ chat_deletenpcchat(nd);
+ chat_createnpcchat(nd, w1, 0, 0, 1, "", 0, 1, MAX_LEVEL);
+
+ add_timer(gettick()+1000, mob_tombtimer, id, 0);
+ nd->u.tomb.spawn_timer -= 1000;
+ }else
+ chat_deletenpcchat(nd);
+
+ return 0;
+}
+
+void mvptomb_destroy(struct mob_data *md)
+{
+ struct npc_data *nd = (struct npc_data *)map_id2bl(md->tomb_nid);
+ if (nd)
+ npc_unload(nd);
+
+ md->tomb_nid = 0;
+}
+
+/*==========================================
* Founds up to N matches. Returns number of matches [Skotlex]
*------------------------------------------*/
int mobdb_searchname_array(struct mob_db** data, int size, const char *str)
@@ -804,6 +887,13 @@
if( md->spawn_timer != INVALID_TIMER )
delete_timer(md->spawn_timer, mob_delayspawn);
md->spawn_timer = add_timer(gettick()+spawntime, mob_delayspawn, md->bl.id, 0);
+
+ // MvP tomb [GreenBox]
+ if (battle_config.mvp_tomb_enabled && md->spawn->state.boss){
+ struct map_session_data *mvp_sd = map_id2sd(md->target_id);
+ mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
+ }
+
return 0;
}

@@ -890,6 +980,10 @@
// Added for carts, falcons and pecos for cloned monsters. [Valaris]
md->sc.option = md->db->option;

+ // MvP tomb [GreenBox]
+ if (md->tomb_nid)
+ mvptomb_destroy(md);
+
map_addblock(&md->bl);
clif_spawn(&md->bl);
skill_unit_move(&md->bl,tick,1);
@@ -2446,6 +2540,9 @@
if(!md->spawn) //Tell status_damage to remove it from memory.
return 5; // Note: Actually, it's 4. Oh well...

+ if (battle_config.mvp_tomb_enabled && md->spawn->state.boss)
+ md->target_id = mvp_sd->bl.id;
+
if( !rebirth )
mob_setdelayspawn(md); //Set respawning.
return 3; //Remove from map.
@@ -4334,6 +4431,8 @@
add_timer_interval(gettick()+MIN_MOBTHINKTIME,mob_ai_hard,0,0,MIN_MOBTHINKTIME);
add_timer_interval(gettick()+MIN_MOBTHINKTIME*10,mob_ai_lazy,0,0,MIN_MOBTHINKTIME*10);

+ add_timer_func_list(mob_tombtimer,"mob_tombtimer");// [malufett]
+
return 0;
}

@@ -4367,4 +4466,4 @@
ers_destroy(item_drop_ers);
ers_destroy(item_drop_list_ers);
return 0;
-}
+}
\ No newline at end of file
Index: src/map/mob.h
===================================================================
--- src/map/mob.h (revision 15090)
+++ src/map/mob.h (working copy)
@@ -161,6 +161,8 @@
short skillidx;
unsigned int skilldelay[MAX_MOBSKILL];
char npc_event[EVENT_NAME_LENGTH];
+
+ int tomb_nid;
};


@@ -277,6 +279,11 @@
int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char *event, int master_id, int mode, int flag, unsigned int duration);
int mob_clone_delete(struct mob_data *md);

+// MvP Tomb System
+void mvptomb_create(struct mob_data *md, char *killer, time_t time);
+void mvptomb_destroy(struct mob_data *md);
+int mob_tombtimer(int tid, unsigned int tick, int id, intptr_t data);
+
void mob_reload(void);

#endif /* _MOB_H_ */
Index: src/map/npc.c
===================================================================
--- src/map/npc.c (revision 15090)
+++ src/map/npc.c (working copy)
@@ -27,6 +27,7 @@
#include "unit.h"
#include "npc.h"
#include "chat.h"
+#include "atcommand.h"

#include <stdio.h>
#include <stdlib.h>
@@ -1087,6 +1088,8 @@
case SCRIPT:
run_script(nd->u.scr.script,0,sd->bl.id,nd->bl.id);
break;
+ case TOMB:
+ run_tomb(sd,nd);
}

return 0;
@@ -2634,6 +2637,48 @@
clif_spawn(&nd->bl);// fade in
}

+// MvP tomb [GreenBox]
+void run_tomb(struct map_session_data* sd, struct npc_data* nd)
+{
+ char buffer[200];
+ char time[10];
+ struct tm *newtime = localtime(&nd->u.tomb.kill_time);
+
+ strftime(time, sizeof(time), "%H:%M", newtime);
+
+ // TODO: Find exact color?
+ snprintf(buffer, sizeof(buffer), msg_txt(657), nd->u.tomb.md->db->name);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ clif_scriptmes(sd, nd->bl.id, msg_txt(658));
+
+ snprintf(buffer, sizeof(buffer), msg_txt(659), time);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ /** MVP Tomb added features
+ -Show time of respawn [malufett]
+ **/
+ if(nd->u.tomb.spawn_time != INVALID_TIMER){
+ int ms = nd->u.tomb.spawn_time;
+ newtime->tm_hour += ms % 86400000 / 3600000;
+ newtime->tm_min += ms % 3600000 / 60000 + 1;
+ if(newtime->tm_min>59){
+ newtime->tm_hour++;
+ newtime->tm_min -= 60;
+ }
+ strftime(time, sizeof(time), "%H:%M", newtime);
+ snprintf(buffer, sizeof(buffer), msg_txt(900), time);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+ }
+
+ clif_scriptmes(sd, nd->bl.id, msg_txt(660));
+
+ snprintf(buffer, sizeof(buffer), msg_txt(661), nd->u.tomb.killer_name[0] ? nd->u.tomb.killer_name : "Unknown");
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ clif_scriptclose(sd, nd->bl.id);
+}
+
/// Parses a function.
/// function%TAB%script%TAB%<function name>%TAB%{<code>}
static const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath)
Index: src/map/npc.h
===================================================================
--- src/map/npc.h (revision 15090)
+++ src/map/npc.h (working copy)
@@ -62,6 +62,13 @@
short x,y; // destination coords
unsigned short mapindex; // destination map
} warp;
+ struct {
+ struct mob_data *md;
+ time_t kill_time;
+ char killer_name[NAME_LENGTH];
+ int spawn_time; //malufett
+ int spawn_timer;
+ } tomb;
} u;
};

@@ -155,6 +162,8 @@
int npc_duplicate4instance(struct npc_data *snd, int m);
int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int points);

+void run_tomb(struct map_session_data* sd, struct npc_data* nd);
+
extern struct npc_data* fake_nd;

#endif /* _NPC_H_ */
Index: src/map/unit.c
===================================================================
--- src/map/unit.c (revision 15090)
+++ src/map/unit.c (working copy)
@@ -2215,6 +2215,9 @@
}
if( mob_is_clone(md->class_) )
mob_clone_delete(md);
+ if( md->tomb_nid )
+ mvptomb_destroy(md);
+
break;
}
case BL_HOM:

Спасибо

Ссылка на комментарий
Поделиться на другие сайты

  • 11 месяцев спустя...

По ссылке есть для еа 15090


Index: conf/battle/monster.conf
===================================================================
--- conf/battle/monster.conf (revision 15090)
+++ conf/battle/monster.conf (working copy)
@@ -213,3 +213,7 @@

// Should MVP slaves retain their target when summoned back to their master?
mob_slave_keep_target: yes
+
+// Wheter or not to spawn the mvp tomb.
+// See http://irowiki.org/wiki/MVP#Gravestone
+mvp_tomb_enabled: yes
\ No newline at end of file
Index: conf/msg_athena.conf
===================================================================
--- conf/msg_athena.conf (revision 15090)
+++ conf/msg_athena.conf (working copy)
@@ -535,5 +535,17 @@
//...
650: Unknown Job

+// MvP Tomb
+// Added here so it can be easily translated
+656: Tomb
+657: [ ^EE0000%s^000000 ]
+658: Has met its demise
+659: Time of death : ^EE0000%s^000000
+660: Defeated by
+661: [^EE0000%s^000000]
+// Added features [malufett]
+900: Time of respawn: ^EE0000%s^000000
+901: Time left: %02i:%02i:%02i
+
//Custom translations
import: conf/import/msg_conf.txt
Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 15090)
+++ src/map/battle.c (working copy)
@@ -4023,6 +4023,7 @@
{ "bg_magic_attack_damage_rate", &battle_config.bg_magic_damage_rate, 60, 0, INT_MAX, },
{ "bg_misc_attack_damage_rate", &battle_config.bg_misc_damage_rate, 60, 0, INT_MAX, },
{ "bg_flee_penalty", &battle_config.bg_flee_penalty, 20, 0, INT_MAX, },
+ { "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1, },
};


Index: src/map/battle.h
===================================================================
--- src/map/battle.h (revision 15090)
+++ src/map/battle.h (working copy)
@@ -497,6 +497,8 @@
int bg_magic_damage_rate;
int bg_misc_damage_rate;
int bg_flee_penalty;
+
+ int mvp_tomb_enabled;
} battle_config;

void do_init_battle(void);
Index: src/map/map.h
===================================================================
--- src/map/map.h (revision 15090)
+++ src/map/map.h (working copy)
@@ -199,7 +199,7 @@
//For common mapforeach calls. Since pets cannot be affected, they aren't included here yet.
#define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER)

-enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP };
+enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP, TOMB };

enum {
RC_FORMLESS=0,
Index: src/map/mob.c
===================================================================
--- src/map/mob.c (revision 15090)
+++ src/map/mob.c (working copy)
@@ -33,6 +33,7 @@
#include "atcommand.h"
#include "date.h"
#include "quest.h"
+#include "chat.h"

#include <stdio.h>
#include <stdlib.h>
@@ -115,6 +116,88 @@
}

/*==========================================
+ * MvP Tomb [GreenBox]
+ *------------------------------------------*/
+void mvptomb_create(struct mob_data *md, char *killer, time_t time)
+{
+ struct npc_data *nd;
+ const struct TimerData * timer_data = get_timer(md->spawn_timer);
+
+ CREATE(nd, struct npc_data, 1);
+
+ nd->bl.id = md->tomb_nid = npc_get_new_npc_id();
+
+ nd->ud.dir = md->ud.dir;
+ nd->bl.m = md->bl.m;
+ nd->bl.x = md->bl.x;
+ nd->bl.y = md->bl.y;
+ nd->bl.type = BL_NPC;
+
+ safestrncpy(nd->name, msg_txt(656), sizeof(nd->name));
+
+ nd->class_ = 565;
+ nd->speed = 200;
+ nd->subtype = TOMB;
+
+ nd->u.tomb.md = md;
+ nd->u.tomb.kill_time = time;
+ nd->u.tomb.spawn_time = nd->u.tomb.spawn_timer = (DIFF_TICK(timer_data->tick, gettick()) + 60);
+
+ if (killer)
+ safestrncpy(nd->u.tomb.killer_name, killer, NAME_LENGTH);
+ else
+ nd->u.tomb.killer_name[0] = '\0';
+
+ map_addnpc(nd->bl.m, nd);
+ map_addblock(&nd->bl);
+ status_set_viewdata(&nd->bl, nd->class_);
+ status_change_init(&nd->bl);
+ unit_dataset(&nd->bl);
+ clif_spawn(&nd->bl);
+
+ add_timer(gettick()+1000, mob_tombtimer, nd->bl.id, 0);
+}
+
+/**
+ MVP Tomb Added Features
+ -Show time left before respawning [malufett]
+**/
+int mob_tombtimer(int tid, unsigned int tick, int id, intptr_t data)
+{
+ struct npc_data *nd = (struct npc_data *)map_id2bl(id);
+ int ms = nd->u.tomb.spawn_timer, hour=0, min=0, sec=0;
+
+ if( nd && ms > 0)
+ {
+ char w1[256];
+
+ hour = ms / 3600000;
+ min = ms % 3600000 / 60000;
+ sec = ms % 60000 / 1000;
+
+ sprintf(w1, msg_txt(901), hour , min, sec);
+
+ chat_deletenpcchat(nd);
+ chat_createnpcchat(nd, w1, 0, 0, 1, "", 0, 1, MAX_LEVEL);
+
+ add_timer(gettick()+1000, mob_tombtimer, id, 0);
+ nd->u.tomb.spawn_timer -= 1000;
+ }else
+ chat_deletenpcchat(nd);
+
+ return 0;
+}
+
+void mvptomb_destroy(struct mob_data *md)
+{
+ struct npc_data *nd = (struct npc_data *)map_id2bl(md->tomb_nid);
+ if (nd)
+ npc_unload(nd);
+
+ md->tomb_nid = 0;
+}
+
+/*==========================================
* Founds up to N matches. Returns number of matches [Skotlex]
*------------------------------------------*/
int mobdb_searchname_array(struct mob_db** data, int size, const char *str)
@@ -804,6 +887,13 @@
if( md->spawn_timer != INVALID_TIMER )
delete_timer(md->spawn_timer, mob_delayspawn);
md->spawn_timer = add_timer(gettick()+spawntime, mob_delayspawn, md->bl.id, 0);
+
+ // MvP tomb [GreenBox]
+ if (battle_config.mvp_tomb_enabled && md->spawn->state.boss){
+ struct map_session_data *mvp_sd = map_id2sd(md->target_id);
+ mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
+ }
+
return 0;
}

@@ -890,6 +980,10 @@
// Added for carts, falcons and pecos for cloned monsters. [Valaris]
md->sc.option = md->db->option;

+ // MvP tomb [GreenBox]
+ if (md->tomb_nid)
+ mvptomb_destroy(md);
+
map_addblock(&md->bl);
clif_spawn(&md->bl);
skill_unit_move(&md->bl,tick,1);
@@ -2446,6 +2540,9 @@
if(!md->spawn) //Tell status_damage to remove it from memory.
return 5; // Note: Actually, it's 4. Oh well...

+ if (battle_config.mvp_tomb_enabled && md->spawn->state.boss)
+ md->target_id = mvp_sd->bl.id;
+
if( !rebirth )
mob_setdelayspawn(md); //Set respawning.
return 3; //Remove from map.
@@ -4334,6 +4431,8 @@
add_timer_interval(gettick()+MIN_MOBTHINKTIME,mob_ai_hard,0,0,MIN_MOBTHINKTIME);
add_timer_interval(gettick()+MIN_MOBTHINKTIME*10,mob_ai_lazy,0,0,MIN_MOBTHINKTIME*10);

+ add_timer_func_list(mob_tombtimer,"mob_tombtimer");// [malufett]
+
return 0;
}

@@ -4367,4 +4466,4 @@
ers_destroy(item_drop_ers);
ers_destroy(item_drop_list_ers);
return 0;
-}
+}
\ No newline at end of file
Index: src/map/mob.h
===================================================================
--- src/map/mob.h (revision 15090)
+++ src/map/mob.h (working copy)
@@ -161,6 +161,8 @@
short skillidx;
unsigned int skilldelay[MAX_MOBSKILL];
char npc_event[EVENT_NAME_LENGTH];
+
+ int tomb_nid;
};


@@ -277,6 +279,11 @@
int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char *event, int master_id, int mode, int flag, unsigned int duration);
int mob_clone_delete(struct mob_data *md);

+// MvP Tomb System
+void mvptomb_create(struct mob_data *md, char *killer, time_t time);
+void mvptomb_destroy(struct mob_data *md);
+int mob_tombtimer(int tid, unsigned int tick, int id, intptr_t data);
+
void mob_reload(void);

#endif /* _MOB_H_ */
Index: src/map/npc.c
===================================================================
--- src/map/npc.c (revision 15090)
+++ src/map/npc.c (working copy)
@@ -27,6 +27,7 @@
#include "unit.h"
#include "npc.h"
#include "chat.h"
+#include "atcommand.h"

#include <stdio.h>
#include <stdlib.h>
@@ -1087,6 +1088,8 @@
case SCRIPT:
run_script(nd->u.scr.script,0,sd->bl.id,nd->bl.id);
break;
+ case TOMB:
+ run_tomb(sd,nd);
}

return 0;
@@ -2634,6 +2637,48 @@
clif_spawn(&nd->bl);// fade in
}

+// MvP tomb [GreenBox]
+void run_tomb(struct map_session_data* sd, struct npc_data* nd)
+{
+ char buffer[200];
+ char time[10];
+ struct tm *newtime = localtime(&nd->u.tomb.kill_time);
+
+ strftime(time, sizeof(time), "%H:%M", newtime);
+
+ // TODO: Find exact color?
+ snprintf(buffer, sizeof(buffer), msg_txt(657), nd->u.tomb.md->db->name);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ clif_scriptmes(sd, nd->bl.id, msg_txt(658));
+
+ snprintf(buffer, sizeof(buffer), msg_txt(659), time);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ /** MVP Tomb added features
+ -Show time of respawn [malufett]
+ **/
+ if(nd->u.tomb.spawn_time != INVALID_TIMER){
+ int ms = nd->u.tomb.spawn_time;
+ newtime->tm_hour += ms % 86400000 / 3600000;
+ newtime->tm_min += ms % 3600000 / 60000 + 1;
+ if(newtime->tm_min>59){
+ newtime->tm_hour++;
+ newtime->tm_min -= 60;
+ }
+ strftime(time, sizeof(time), "%H:%M", newtime);
+ snprintf(buffer, sizeof(buffer), msg_txt(900), time);
+ clif_scriptmes(sd, nd->bl.id, buffer);
+ }
+
+ clif_scriptmes(sd, nd->bl.id, msg_txt(660));
+
+ snprintf(buffer, sizeof(buffer), msg_txt(661), nd->u.tomb.killer_name[0] ? nd->u.tomb.killer_name : "Unknown");
+ clif_scriptmes(sd, nd->bl.id, buffer);
+
+ clif_scriptclose(sd, nd->bl.id);
+}
+
/// Parses a function.
/// function%TAB%script%TAB%<function name>%TAB%{<code>}
static const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath)
Index: src/map/npc.h
===================================================================
--- src/map/npc.h (revision 15090)
+++ src/map/npc.h (working copy)
@@ -62,6 +62,13 @@
short x,y; // destination coords
unsigned short mapindex; // destination map
} warp;
+ struct {
+ struct mob_data *md;
+ time_t kill_time;
+ char killer_name[NAME_LENGTH];
+ int spawn_time; //malufett
+ int spawn_timer;
+ } tomb;
} u;
};

@@ -155,6 +162,8 @@
int npc_duplicate4instance(struct npc_data *snd, int m);
int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int points);

+void run_tomb(struct map_session_data* sd, struct npc_data* nd);
+
extern struct npc_data* fake_nd;

#endif /* _NPC_H_ */
Index: src/map/unit.c
===================================================================
--- src/map/unit.c (revision 15090)
+++ src/map/unit.c (working copy)
@@ -2215,6 +2215,9 @@
}
if( mob_is_clone(md->class_) )
mob_clone_delete(md);
+ if( md->tomb_nid )
+ mvptomb_destroy(md);
+
break;
}
case BL_HOM:

Мод добавился на eAmod без ошибок, после убийства МВП - тоже всё появляется и как бы ок. Но вот после того как таймер заканчивается и МВП должен респаться, то падает сервер со следующей ошибкой:


Program received signal SIGSEGV, Segmentation fault.
mob_tombtimer (tid=<value optimized out>, tick=<value optimized out>,
id=110056812, data=<value optimized out>) at mob.c:175
175 int ms = nd->u.tomb.spawn_timer, hour=0, min=0, sec=0;
(gdb) bt full
#0 mob_tombtimer (tid=<value optimized out>, tick=<value optimized out>,
id=110056812, data=<value optimized out>) at mob.c:175
ms = <value optimized out>
#1 0x000000000057855f in do_timer (tick=<value optimized out>) at timer.c:371
tid = <value optimized out>
diff = -2
__FUNCTION__ = "do_timer"
#2 0x0000000000574ee4 in main (argc=1, argv=0x7fffffffe7a8) at core.c:291
next = <value optimized out>

Изменено пользователем Victor
Ссылка на комментарий
Поделиться на другие сайты

Меняем код функции mob_tombtimer на:


int mob_tombtimer(int tid, unsigned int tick, int id, intptr_t data)
{
struct npc_data* nd = (struct npc_data*)map_id2bl(id);

if (nd)
{
int hour, min, sec;
char message[256];
int ms = nd->u.tomb.spawn_timer;

chat_deletenpcchat(nd);

if (ms <= 0)
{
return 0;
}

hour = ms / 3600000;
min = ms % 3600000 / 60000;
sec = ms % 60000 / 1000;

sprintf(message, "Time left: %02i:%02i:%02i", hour , min, sec);

chat_createnpcchat(nd, message, 0, 0, 1, "", 0, 1, MAX_LEVEL);

add_timer(gettick()+1000, mob_tombtimer, id, 0);
nd->u.tomb.spawn_timer -= 1000;
}

return 0;
}

  • Upvote 1
Ссылка на комментарий
Поделиться на другие сайты

×
×
  • Создать...
Яндекс.Метрика