-
Posts
272 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Scofield
-
I'm using eAthena and my Map server crashes when the monster is respawned... can you help me about this? or @reloadscript 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:
-
the cast bar is not appear as if she were invisible, the character stands still as if using the skill over the bar does not appear
-
Yes I could try but my computer is apple and I can not run a local emulator
-
Yes it's true, my host does not give ssh access, so I can not see the errors.
-
Hello in my emulator creators are invoking thousands of mobs in skill Follower Summons, wanted them could only summon one at a time.
-
Goldtime have a project and wanted to use this ancient script plus it does not work in the new emulators, wanted to know why
-
Trx ... Thank you, it worked he also has another problem, if the adiversario @die or leave the map the script does the prize for those who stay know what the problem?
-
I want this event begins only once a week, on Saturday the 20 hours. prontera,134,231,5 script UFC 65,{ mes "[ UFC ]"; mes "Olá "+ strcharinfo(0) +"!"; mes "Bem-Vindo ao Evento UFC."; next; mes "Deseja entrar?"; switch(select("Sim, entrar no evento.", "Não, talvez depois.")){ case 1: if ($aberto == 0) goto fechado; warp "ufc_pvp2",49,50; dispbottom "Você está dentro do Evento UFC! Boa Sorte!"; end; case 2: close2; end; } fechado: mes "Desculpe o evento está fechado."; mes "Volte mais tarde"; close; end; } ufc_pvp2,0,0,0 script NoEvento -1,{ OnWhisperGlobal: if (getgmlevel() == 99) { mes "Deseja Ligar o Evento?"; switch(select("Ligar","Sair")) { case 1: dispbottom "Evento Ligado com Sucesso!"; callsub OnEventStart; close; end; case 2: close; end; } } OnClock0100: callsub OnEventStart; OnClock0300: callsub OnEventStart; OnClock0500: callsub OnEventStart; Onclock0700: callsub OnEventStart; Onclock0900: callsub OnEventStart; OnClock1100: callsub OnEventStart; OnClock1200: callsub OnEventStart; OnClock1300: callsub OnEventStart; OnClock1500: callsub OnEventStart; OnClock1700: callsub OnEventStart; OnClock1900: callsub OnEventStart; OnClock2100: callsub OnEventStart; OnClock2300: callsub OnEventStart; OnEventStart: set $aberto,1; pvpoff "ufc_pvp2"; atcommand "@killmonster2"; announce "[Evento UFC]: O Evento UFC está aberto você tem 4 minutos para entrar!",0; sleep2 60000; announce "[Evento UFC]: Você tem 3 minutos para entrar no evento!",0; sleep2 60000; announce "[Evento UFC]: Você tem 2 minutos para entrar no evento!",0; sleep2 60000; announce "[Evento UFC]: Você tem 1 minuto para entrar no evento!",0; sleep2 60000; announce "[Evento UFC]: O Evento UFC Começou! Portais Fechados!",0; set $aberto,0; goto comecou; end; comecou: if(getmapusers("ufc_pvp2") == 1) goto cancelado; MapAnnounce "ufc_pvp2", "[Evento UFC]: O Evento terá Inicio em 30 Segundos! Preparem-Se!",0; sleep2 27000; MapAnnounce "ufc_pvp2", "Preparados ?",0; sleep2 1000; MapAnnounce "ufc_pvp2", "Vamos lá!",0; sleep2 1000; MapAnnounce "ufc_pvp2", "Valendoo!!!",0; pvpon "ufc_pvp2"; atcommand "@skillon"; end; cancelado: announce "[Evento UFC]: O Evento UFC foi cancelado por falta de jogadores.",0; sleep2 5000; mapwarp "ufc_pvp2","cydonia",138,86; end; } - script MortoVivo -1,{ OnPCKillEvent: if (strcharinfo(3) != "ufc_pvp2") end; if (getmapusers("ufc_pvp2") > 1) end; monster "ufc_pvp2", 49, 50, "Baú de Guerra", 1732, 1, "Entregador#func::OnQuebrarBau"; end; OnPCDieEvent: if (strcharinfo(3) != "ufc_pvp2") end; warp "cydonia",138,86; end; } - script Entregador#func -1,{ OnQuebrarBau: pvpoff "ufc_pvp2"; getitem 7539,20; //Caixa de Presença announce "O vencedor do Evento UFC foi o jogador "+strcharinfo( 0 )+"!",bc_all; warp "cydonia",138,86; end; } // MapFlags ufc_pvp2 mapflag nomemo ufc_pvp2 mapflag nopenalty ufc_pvp2 mapflag nobranch ufc_pvp2 mapflag pvp_noguild ufc_pvp2 mapflag noloot ufc_pvp2 mapflag noexp ufc_pvp2 mapflag noteleport ufc_pvp2 mapflag noreturn ufc_pvp2 mapflag nowarp ufc_pvp2 mapflag nowarpto ufc_pvp2 mapflag nosave SavePoint ufc_pvp2 mapflag pvp ufc_pvp2 mapflag pvp_noparty
-
I really want to leave the fast asura, the more fury atraza much, I would leave the asura equal to this .. I have already made all the conf with 0 delay and cast .. Zen and the fury has no delay
-
Thanks it worked! ... Cydh I wonder if you know how to make the animation faster MO_EXPLOSIONSPIRITS instead of removing ...
-
thanks I'll try .. I did so to be correct? /*========================================== * skill attack effect and damage * R 01de <skill ID>.w <src ID>.l <dst ID>.l <tick>.l <src delay>.l <dst delay>.l <damage>.l <skillv>.w <div>.w <type>.B *------------------------------------------*/ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,int skill_id,int skill_lv,int type) { unsigned char buf[64]; struct status_change *sc; nullpo_ret(src); nullpo_ret(dst); + if (skill_id == MO_EXPLOSIONSPIRITS) return; type = clif_calc_delay(type,div,damage,ddelay); sc = status_get_sc(dst); if(sc && sc->count) { if(sc->data[SC_HALLUCINATION] && damage) damage = damage*(sc->data[SC_HALLUCINATION]->val2) + rand()%100; } Edit. did not work, the fury is still with animation this is to speed up the animation of fury would also be a positive hum ... know it worked leave faster animation instead of removing
-
when you equip any weapon aspd is decreased
-
I wonder if it is possible to remove the animation skill MO_EXPLOSIONSPIRITS, or leave faster animation.
-
I wonder how I take the aspd penalty to team weapons
-
I wonder how I reset the ranking of Taekwon
-
I would change the formula of the SPD, Example: A character with 186 SPD has the movement of attack as if it had 191 Achei esso no status.c onde eu edito para obter resultado desejado? // ----- ASPD CALCULATION ----- // Unlike other stats, ASPD rate modifiers from skills/SCs/items/etc are first all added together, then the final modifier is applied // Basic ASPD value i = status_base_amotion_pc(sd,status); status->amotion = cap_value(i,battle_config.max_aspd,2000); // Relative modifiers from passive skills if((skill=pc_checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK) status->aspd_rate -= 5*skill; if((skill = pc_checkskill(sd,SG_DEVIL)) > 0 && !pc_nextjobexp(sd)) status->aspd_rate -= 30*skill; if((skill=pc_checkskill(sd,GS_SINGLEACTION))>0 && (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) status->aspd_rate -= ((skill+1)/2) * 10; if(pc_isriding(sd)) status->aspd_rate += 500-100*pc_checkskill(sd,KN_CAVALIERMASTERY); status->adelay = 2*status->amotion;
-
I got this error in my console would like to know why and how to solve [Debug]: at char.c:850 - INSERT INTO `inventory`(`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `card0`, `card1`, `card2`, `card3`) VALUES ('4480', '2630', '1', '8', '1', '0', '0', '0', '4430', '4430', '4430', '0') Up
-
Poring race event be giving to bet after the race starts, then see which players poring be winning bet and it almost always win and I would like to fix it <<(google translater) //NPC Checker - script Checker#prace0 -1,{ end; OnChequeo: for(set .@tmp1,0;.@tmp1<(getarraysize($prace_bidders));set .@tmp1,.@tmp1+1) { if(attachrid($prace_bidders[.@tmp1])) { if( @prace_playing != 1) end; dispbottom "O vencedor é o "+$prace_winner$+" e você apostou em "+prace_winner$+"."; if( prace_winner$ == $prace_winner$ && prace_winner$ != "") { dispbottom "Você venceu!"; mapannounce "cydonia"," Parabéns! "+strcharinfo(0)+" venceu!",1,0xFFAB54; getitem 7539,10; emotion 21,1; } else dispbottom "Você perdeu."; emotion 28,1; set prace_winner$,""; set @prace_playing,0; } //else { announce .@tmp1+" || "+$prace_bidders[.@tmp1],bc_all; } //debug } for( set .@tmp1,0; .@tmp1 < (getarraysize( $prace_bidders )); set .@tmp1,.@tmp1 + 1 ) { set $prace_bidders[.@tmp1],0; } } - script Timers#prace0 -1,{ OnClock0000: callsub OnCalll; OnClock0200: callsub OnCalll; OnClock0400: callsub OnCalll; OnClock0600: callsub OnCalll; OnClock0816: callsub OnCalll; OnClock1023: callsub OnCalll; OnClock1200: callsub OnCalll; OnClock1400: callsub OnCalll; OnClock1600: callsub OnCalll; OnClock1800: callsub OnCalll; OnClock2000: callsub OnCalll; OnClock2200: callsub OnCalll; OnCalll: set $prace_gate,1; announce "A 'Corrida dos Porings' irá começar em breve, façam suas apostas!",bc_all|bc_yellow; end; } //====== Principal: ============================================ cydonia,100,59,3 script Bidder#prace0 765,{ set .@prace_zeny,20000000; // Preço para apostar. [Padrão: 20000000] if ($prace_random < 1) callsub OnInit; if (@prace_playing==1) callsub AlreadyPlaying; if($prace_gate == 0){ mes "[Bidder]"; mes "Não teremos corrida no momento..."; close; } getmapxy(.@mapname$,.@x1,.@y,1,"Poring#prace1"); getmapxy(.@mapname$,.@x2,.@y,1,"Angeling#prace2"); getmapxy(.@mapname$,.@x3,.@y,1,"Metaling#prace3"); getmapxy(.@mapname$,.@x4,.@y,1,"Deviling#prace4"); getmapxy(.@mapname$,.@x5,.@y,1,"Poring Noel#prace5"); if (.@x1 != 103 || .@x2 != 106 || .@x3 != 109 || .@x4 != 112 || .@x5 != 115){ mes "[Bidder]"; mes "Uma corrida está em andamento..."; close; } mes "[Bidder]"; mes "Escolha o poring em que deseja apostar:";mes "Irá custar "+.@prace_zeny+" Zeny.";next; switch(select("Poring","Angeling","Metaling","Deviling","Poring Noel","Poporing")){ case 1: callfunc "OnBid","Poring"; case 2: callfunc "OnBid","Angeling"; case 3: callfunc "OnBid","Metaling"; case 4: callfunc "OnBid","Deviling"; case 5: callfunc "OnBid","Poring Noel"; } OnReady: set $prace_bets,$prace_bets+1; set $prace_bidders[$prace_bets],getcharid(3); set @prace_playing,1; mes "[Bidder]"; mes "Eu tenho "+$prace_bets+" apostas."; setnpctimer 60000; startnpctimer; npctalk strcharinfo(0)+" fez sua aposta!"; close; Start1: setnpctimer 0; startnpctimer; end; AlreadyPlaying: mes "[Bidder]"; mes "Você apostou em ^00bb00"+prace_winner$+"^000000."; close; StartRace: donpcevent "Metaling#prace3::OnRace"; donpcevent "Poring#prace1::OnRace"; donpcevent "Angeling#prace2::OnRace"; donpcevent "Poring Noel#prace5::OnRace"; donpcevent "Deviling#prace4::OnRace"; end; OnStopRace: donpcevent "Poring#prace1::OnStop"; donpcevent "Angeling#prace2::OnStop"; donpcevent "Metaling#prace3::OnStop"; donpcevent "Deviling#prace4::OnStop"; donpcevent "Poring Noel#prace5::OnStop"; if ($prace_winner$!="") callsub WinRace; end; ReturnRace: donpcevent "Poring#prace1::OnReturn"; donpcevent "Angeling#prace2::OnReturn"; donpcevent "Metaling#prace3::OnReturn"; donpcevent "Deviling#prace4::OnReturn"; donpcevent "Poring Noel#prace5::OnReturn"; end; WinRace: set $prace_gate,0; mapannounce "cydonia","O vencedor é o "+$prace_winner$+".",1,0xFFAB54; donpcevent "Checker#prace0::OnChequeo"; setnpctimer 30000;startnpctimer; end; OnInit: set $prace_random,70; set $prace_random2,600; set $prace_winner$,""; set $prace_bets,0; set $prace_bidders,0; end; OnTimer500: mapannounce "cydonia","Porings, em suas marcas...",1,0xFFAB54; end; OnTimer3000: mapannounce "cydonia","...3...",1,0xFFAB54; end; OnTimer4000: mapannounce "cydonia","...2...",1,0xFFAB54; end; OnTimer5000: mapannounce "cydonia","...1...",1,0xFFAB54; callsub StartRace; end; OnTimer6000: stopnpctimer; mapannounce "cydonia","Gooo!!!",1,0xFFAB54; end; OnTimer35000: set $prace_winner$,""; set $prace_bets,0; stopnpctimer; callsub ReturnRace; OnTimer90000: npctalk "Eu tenho "+$prace_bets+" aposta(s). Alguém mais?"; end; OnTimer110000: npctalk "A corrida irá começar em breve. Última chance."; end; OnTimer120000: callsub Start1; } //====== Função Apostar: ======================================= function script OnBid { getmapxy(.@mapname$,.@x1,.@y,1,"Poring#prace1"); getmapxy(.@mapname$,.@x2,.@y,1,"Angeling#prace2"); getmapxy(.@mapname$,.@x3,.@y,1,"Metaling#prace3"); getmapxy(.@mapname$,.@x4,.@y,1,"Deviling#prace4"); getmapxy(.@mapname$,.@x5,.@y,1,"Poring Noel#prace5"); if (.@x1 == 103 || .@x2 == 106 || .@x3 == 109 || .@x4 == 112 || .@x5 == 115){ if (Zeny < .@prace_zeny) { callsub OnZeny; } else { set Zeny,Zeny-.@prace_zeny; } set prace_winner$,getarg(0); callsub OnReady; } mes "[Bidder]"; mes "Uma corrida está em andamento..."; close; OnZeny: set prace_winner$,""; mes "[Bidder]"; mes "Você não tem Zeny suficiente."; close; OnReady: set $prace_bets,$prace_bets+1; set $prace_bidders[$prace_bets],getcharid(3); set @prace_playing,1; mes "[Bidder]"; mes "Eu tenho "+$prace_bets+" apostas."; setnpctimer 60000; startnpctimer; npctalk strcharinfo(0)+" fez sua aposta!"; close; } //====== Monstros: ============================================== cydonia,103,54,4 script Poring#prace1 1002,{ end; OnRace: initnpctimer; startnpctimer; end; OnStop: stopnpctimer; end; OnReturn: npcwalkto 103,54; end; OnTimer1100: getmapxy(.@mapname$,.@x,.@y,1,"Poring#prace1"); if(rand(100) < $prace_random) npcwalkto .@x,.@y-1; setnpctimer rand($prace_random2); startnpctimer; if ((.@y-1) == 31) { set $prace_winner$,"Poring"; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; } } cydonia,106,54,4 script Angeling#prace2 1096,{ end; OnRace: initnpctimer; startnpctimer; end; OnStop: stopnpctimer; end; OnReturn: npcwalkto 106,54; end; OnTimer1100: getmapxy(.@mapname$,.@x,.@y,1,"Angeling#prace2"); if(rand(100) < $prace_random) npcwalkto .@x,.@y-1; setnpctimer rand($prace_random2); startnpctimer; if ((.@y-1) == 31) { set $prace_winner$,"Angeling"; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; } } cydonia,109,54,4 script Metaling#prace3 1613,{ end; OnRace: initnpctimer; startnpctimer; end; OnStop: stopnpctimer; end; OnReturn: npcwalkto 109,54; end; OnTimer1100: getmapxy(.@mapname$,.@x,.@y,1,"Metaling#prace3"); if(rand(100) < $prace_random) npcwalkto .@x,.@y-1; setnpctimer rand($prace_random2); startnpctimer; if ((.@y-1) == 31) { set $prace_winner$,"Metaling"; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; } } cydonia,112,54,4 script Deviling#prace4 1582,{ end; OnRace: initnpctimer; startnpctimer; end; OnStop: stopnpctimer; end; OnReturn: npcwalkto 112,54; end; OnTimer1100: getmapxy(.@mapname$,.@x,.@y,1,"Deviling#prace4"); if(rand(100) < $prace_random) npcwalkto .@x,.@y-1; setnpctimer rand($prace_random2); startnpctimer; if ((.@y-1) == 31) { set $prace_winner$,"Deviling"; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; } } cydonia,115,54,4 script Poring Noel#prace5 1062,{ end; OnRace: initnpctimer; startnpctimer; end; OnStop: stopnpctimer; end; OnReturn: npcwalkto 115,54; end; OnTimer1100: getmapxy(.@mapname$,.@x,.@y,1,"Poring Noel#prace5"); if(rand(100) < $prace_random) npcwalkto .@x,.@y-1; setnpctimer rand($prace_random2); startnpctimer; if ((.@y-1) == 31) { set $prace_winner$,"Poring Noel"; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; } }