Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: CustomDeathMessage [MuEmu]  (Visto 2220 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline malon2k on: April 06, 2017, 07:45:38 PM

  • Php Coder
  • 0 puntos por ventas
  • *
  • Rank: Avanzado
  • Posts: 143
  • Gracias recibida: 4619
  • ar


Agregue estas lineas en serverinfo.cpp
 
arriba
#include "CustomDeathMessage.h" 

y debajo de

in void CServerInfo::ReadCustomInfo() // OK 

Agregue

gCustomDeathMessage.Load(gPath.GetFullPath("Custom\\CustomDeathMessage.txt")); 

ObjectManager.cpp

#include "CustomDeathMessage.h" 

Debajo de
GCUserDieSend(lpTarget,lpTarget->Index,skill,lpObj->Index); 

Agregue
if(lpObj->Type == OBJECT_MONSTER) {
gCustomDeathMessage.GetDeathText(lpTarget,lpObj, lpObj->Class);
}




Code: [Select]
#pragma once

#include "Protocol.h"
#include "User.h"


struct CUSTOMDEATHMESSAGE_INFO
{
int Index;
char Text[128];
};


class CustomDeathMessage
{
public:
CustomDeathMessage();
virtual ~CustomDeathMessage();
void Load(char* path);
void GetDeathText(LPOBJ lpTarget, LPOBJ lpObj, int index);
bool GetInfo(int index,CUSTOMDEATHMESSAGE_INFO* lpInfo);
private:
std::map<int,CUSTOMDEATHMESSAGE_INFO> m_CustomDeathMessage;
};


extern CustomDeathMessage gCustomDeathMessage;


CustomDeathMessage.cpp


Code: [Select]
// CustomDeathMessage.cpp: implementation of the CGate class.//
//////////////////////////////////////////////////////////////////////


#include "stdafx.h"
#include "CommandManager.h"
#include "CustomDeathMessage.h"
#include "Log.h"
#include "MemScript.h"
#include "Message.h"
#include "Notice.h"
#include "Util.h"


CustomDeathMessage gCustomDeathMessage;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////


CustomDeathMessage::CustomDeathMessage() // OK
{
this->m_CustomDeathMessage.clear();
}


CustomDeathMessage::~CustomDeathMessage() // OK
{


}


void CustomDeathMessage::Load(char* path) // OK
{
CMemScript* lpMemScript = new CMemScript;


if(lpMemScript == 0)
{
ErrorMessageBox(MEM_SCRIPT_ALLOC_ERROR,path);
return;
}


if(lpMemScript->SetBuffer(path) == 0)
{
ErrorMessageBox(lpMemScript->GetLastError());
delete lpMemScript;
return;
}


this->m_CustomDeathMessage.clear();


try
{


while(true)
{


if(lpMemScript->GetToken() == TOKEN_END)
{
break;
}


if(strcmp("end",lpMemScript->GetString()) == 0)
{
break;
}


CUSTOMDEATHMESSAGE_INFO info;


info.Index = lpMemScript->GetNumber();


strcpy_s(info.Text,lpMemScript->GetAsString());


this->m_CustomDeathMessage.insert(std::pair<int,CUSTOMDEATHMESSAGE_INFO>(info.Index,info));
}
}
catch(...)
{
ErrorMessageBox(lpMemScript->GetLastError());
}


delete lpMemScript;
}




void CustomDeathMessage::GetDeathText(LPOBJ lpTarget, LPOBJ lpObj, int index) // OK
{
CUSTOMDEATHMESSAGE_INFO CustomDM;


if(this->GetInfo(index,&CustomDM) == 0)
{
return;
}


GCChatTargetSend(lpTarget,lpObj->Index,CustomDM.Text);
}




bool CustomDeathMessage::GetInfo(int index,CUSTOMDEATHMESSAGE_INFO* lpInfo) // OK
{
std::map<int,CUSTOMDEATHMESSAGE_INFO>::iterator it = this->m_CustomDeathMessage.find(index);


if(it == this->m_CustomDeathMessage.end())
{
return 0;
}
else
{
(*lpInfo) = it->second;
return 1;
}
}

Agregar txt creado en Data/Custom:
CustomDeathMessage.txt

« Ultima edicion: April 07, 2017, 02:53:08 AM by ZabiinoOo »

Gracias:


Offline malon2k #1 on: April 06, 2017, 07:45:56 PM

  • Php Coder
  • 0 puntos por ventas
  • *
  • Rank: Avanzado
  • Posts: 143
  • Gracias recibida: 4619
  • ar
Code: [Select]
//index text 1 "Hihihih I'm Very Strong Monster"
2 "Hihihih I'm Very Strong Monster"
3 "Hihihih I'm Very Strong Monster"
4 "Hihihih I'm Very Strong Monster"
5 "Hihihih I'm Very Strong Monster"
6 "Hihihih I'm Very Strong Monster"
7 "Hihihih I'm Very Strong Monster"
8 "Hihihih I'm Very Strong Monster"
9 "Hihihih I'm Very Strong Monster"
10 "Hihihih I'm Very Strong Monster"
11 "Hihihih I'm Very Strong Monster"
12 "Hihihih I'm Very Strong Monster"
13 "Hihihih I'm Very Strong Monster"
14 "Hihihih I'm Very Strong Monster"
15 "Hihihih I'm Very Strong Monster"
16 "Hihihih I'm Very Strong Monster"
17 "Hihihih I'm Very Strong Monster"
18 "Hihihih I'm Very Strong Monster"
20 "Hihihih I'm Very Strong Monster"
21 "Hihihih I'm Very Strong Monster"
22 "Hihihih I'm Very Strong Monster"
23 "Hihihih I'm Very Strong Monster"
24 "Hihihih I'm Very Strong Monster"
25 "Hihihih I'm Very Strong Monster"
26 "Hihihih I'm Very Strong Monster"
27 "Hihihih I'm Very Strong Monster"
28 "Hihihih I'm Very Strong Monster"
29 "Hihihih I'm Very Strong Monster"
30 "Hihihih I'm Very Strong Monster"
31 "Hihihih I'm Very Strong Monster"
32 "Hihihih I'm Very Strong Monster"
33 "Hihihih I'm Very Strong Monster"
34 "Are You crazy !! You attack me"
35 "Are You crazy !! You attack me"
36 "Are You crazy !! You attack me"
37 "Are You crazy !! You attack me"
38 "Are You crazy !! You attack me"
39 "Are You crazy !! You attack me"
40 "Are You crazy !! You attack me"
41 "Are You crazy !! You attack me"
42 "Are You crazy !! You attack me"
43 "I'm Golden Moster You Are Dead"
44 "Are You crazy !! You attack me"
45 "Are You crazy !! You attack me"
46 "Are You crazy !! You attack me"
47 "Are You crazy !! You attack me"
48 "Are You crazy !! You attack me"
49 "Are You crazy !! You attack me"
50 "Are You crazy !! You attack me"
51 "Are You crazy !! You attack me"
52 "Are You crazy !! You attack me"
53 "I'm Golden Moster You Are Dead"
54 "I'm Golden Moster You Are Dead"
55 "Are You crazy !! You attack me"
56 "Are You crazy !! You attack me"
57 "Are You crazy !! You attack me"
58 "Are You crazy !! You attack me"
59 "Are You crazy !! You attack me"
60 "Are You crazy !! You attack me"
61 "Are You crazy !! You attack me"
62 "Are You crazy !! You attack me"
63 "Next time we do not approach"
64 "Next time we do not approach"
65 "Next time we do not approach"
66 "Next time we do not approach"
67 "Next time we do not approach"
68 "Next time we do not approach"
69 "Next time we do not approach"
70 "Next time we do not approach"
71 "Next time we do not approach"
72 "Next time we do not approach"
73 "Next time we do not approach"
74 "Next time we do not approach"
75 "Next time we do not approach"
76 "Next time we do not approach"
77 "Next time we do not approach"
78 "I'm Golden Moster You Are Dead"
79 "I'm Golden Moster You Are Dead"
80 "I'm Golden Moster You Are Dead"
81 "I'm Golden Moster You Are Dead"
82 "I'm Golden Moster You Are Dead"
83 "I'm Golden Moster You Are Dead"
84 "Now you will have a lesson"
85 "Now you will have a lesson"
86 "Now you will have a lesson"
87 "Now you will have a lesson"
88 "Now you will have a lesson"
89 "Now you will have a lesson"
90 "Now you will have a lesson"
91 "Now you will have a lesson"
92 "Now you will have a lesson"
93 "Now you will have a lesson"
94 "Now you will have a lesson"
95 "Now you will have a lesson"
96 "Now you will have a lesson"
97 "Now you will have a lesson"
98 "Now you will have a lesson"
99 "Now you will have a lesson"
100 "Now you will have a lesson"
101 "Now you will have a lesson"
102 "Now you will have a lesson"
103 "Now you will have a lesson"
104 "Now you will have a lesson"
105 "Now you will have a lesson"
106 "Now you will have a lesson"
107 "Now you will have a lesson"
108 "Now you will have a lesson"
109 "Now you will have a lesson"
110 "Now you will have a lesson"
111 "Now you will have a lesson"
112 "Now you will have a lesson"
113 "Now you will have a lesson"
114 "Now you will have a lesson"
115 "Now you will have a lesson"
116 "Now you will have a lesson"
117 "Now you will have a lesson"
118 "You Are Noob !!"
119 "You Are Noob !!"
120 "You Are Noob !!"
121 "You Are Noob !!"
122 "You Are Noob !!"
123 "You Are Noob !!"
124 "You Are Noob !!"
125 "You Are Noob !!"
126 "You Are Noob !!"
127 "You Are Noob !!"
128 "You Are Noob !!"
129 "You Are Noob !!"
130 "You Are Noob !!"
131 "You Are Noob !!"
132 "You Are Noob !!"
133 "You Are Noob !!"
134 "You Are Noob !!"
135 "You Are Noob !!"
136 "You Are Noob !!"
137 "You Are Noob !!"
138 "You Are Noob !!"
139 "You Are Noob !!"
140 "You Are Noob !!"
141 "You Are Noob !!"
142 "You Are Noob !!"
143 "You Are Noob !!"
144 "You Are Noob !!"
145 "You Are Noob !!"
146 "You Are Noob !!"
147 "You Are Noob !!"
148 "You Are Noob !!"
149 "You Are Noob !!"
150 "You Are Noob !!"
151 "Miss MIss , Come back later"
152 "Miss MIss , Come back later"
153 "Miss MIss , Come back later"
154 "Miss MIss , Come back later"
155 "Miss MIss , Come back later"
156 "Miss MIss , Come back later"
157 "Miss MIss , Come back later"
158 "Miss MIss , Come back later"
159 "Miss MIss , Come back later"
160 "Miss MIss , Come back later"
161 "Miss MIss , Come back later"
162 "Miss MIss , Come back later"
163 "Miss MIss , Come back later"
164 "Miss MIss , Come back later"
165 "Miss MIss , Come back later"
166 "Miss MIss , Come back later"
167 "Miss MIss , Come back later"
168 "Miss MIss , Come back later"
169 "Miss MIss , Come back later"
170 "Miss MIss , Come back later"
171 "Miss MIss , Come back later"
172 "Miss MIss , Come back later"
173 "Miss MIss , Come back later"
174 "Miss MIss , Come back later"
175 "Miss MIss , Come back later"
176 "Miss MIss , Come back later"
177 "Miss MIss , Come back later"
178 "Miss MIss , Come back later"
179 "Miss MIss , Come back later"
180 "Miss MIss , Come back later"
181 "Miss MIss , Come back later"
182 "Miss MIss , Come back later"
183 "Miss MIss , Come back later"
184 "Miss MIss , Come back later"
185 "Miss MIss , Come back later"
186 "Miss MIss , Come back later"
187 "Miss MIss , Come back later"
188 "Miss MIss , Come back later"
189 "Miss MIss , Come back later"
190 "Miss MIss , Come back later"
191 "I am the master and ruler"
192 "I am the master and ruler"
193 "I am the master and ruler"
194 "I am the master and ruler"
195 "I am the master and ruler"
196 "I am the master and ruler"
197 "I am the master and ruler"
198 "I am the master and ruler"
199 "I am the master and ruler"
200 "I am the master and ruler"
201 "Now you will have a lesson"
202 "Now you will have a lesson"
203 "Now you will have a lesson"
204 "Now you will have a lesson"
205 "Now you will have a lesson"
206 "Now you will have a lesson"
207 "Now you will have a lesson"
208 "Now you will have a lesson"
209 "Now you will have a lesson"
210 "Now you will have a lesson"
211 "Now you will have a lesson"
212 "Now you will have a lesson"
213 "Now you will have a lesson"
214 "Now you will have a lesson"
215 "Now you will have a lesson"
216 "Now you will have a lesson"
217 "Now you will have a lesson"
218 "You Are Noob !!"
219 "You Are Noob !!"
220 "You Are Noob !!"
221 "You Are Noob !!"
222 "You Are Noob !!"
223 "You Are Noob !!"
224 "You Are Noob !!"
225 "You Are Noob !!"
226 "You Are Noob !!"
227 "You Are Noob !!"
228 "You Are Noob !!"
229 "You Are Noob !!"
230 "You Are Noob !!"
231 "You Are Noob !!"
232 "You Are Noob !!"
233 "You Are Noob !!"
234 "You Are Noob !!"
235 "You Are Noob !!"
236 "You Are Noob !!"
237 "You Are Noob !!"
238 "You Are Noob !!"
239 "You Are Noob !!"
240 "You Are Noob !!"
241 "You Are Noob !!"
242 "You Are Noob !!"
243 "You Are Noob !!"
244 "You Are Noob !!"
245 "You Are Noob !!"
246 "You Are Noob !!"
247 "You Are Noob !!"
248 "You Are Noob !!"
249 "You Are Noob !!"
250 "You Are Noob !!"
251 "Miss MIss , Come back later"
252 "Miss MIss , Come back later"
253 "Miss MIss , Come back later"
254 "Miss MIss , Come back later"
255 "Miss MIss , Come back later"
256 "Miss MIss , Come back later"
257 "Miss MIss , Come back later"
258 "Miss MIss , Come back later"
259 "Miss MIss , Come back later"
260 "Miss MIss , Come back later"
261 "Miss MIss , Come back later"
262 "Miss MIss , Come back later"
263 "Miss MIss , Come back later"
264 "Miss MIss , Come back later"
265 "Miss MIss , Come back later"
266 "Miss MIss , Come back later"
267 "Miss MIss , Come back later"
268 "Miss MIss , Come back later"
269 "Miss MIss , Come back later"
270 "Miss MIss , Come back later"
271 "Miss MIss , Come back later"
272 "Miss MIss , Come back later"
273 "Miss MIss , Come back later"
274 "Miss MIss , Come back later"
275 "Miss MIss , Come back later"
276 "Miss MIss , Come back later"
277 "Miss MIss , Come back later"
278 "Miss MIss , Come back later"
279 "Miss MIss , Come back later"
280 "Miss MIss , Come back later"
281 "Miss MIss , Come back later"
282 "Miss MIss , Come back later"
283 "Miss MIss , Come back later"
284 "Miss MIss , Come back later"
285 "Miss MIss , Come back later"
286 "Miss MIss , Come back later"
287 "Miss MIss , Come back later"
288 "Miss MIss , Come back later"
289 "Miss MIss , Come back later"
290 "Miss MIss , Come back later"
291 "I am the master and ruler"
292 "I am the master and ruler"
293 "I am the master and ruler"
294 "I am the master and ruler"
295 "I am the master and ruler"
296 "I am the master and ruler"
297 "I am the master and ruler"
298 "I am the master and ruler"
299 "I am the master and ruler"
300 "I am the master and ruler"
301 "Hihihih I'm Very Strong Monster"
302 "Hihihih I'm Very Strong Monster"
303 "Hihihih I'm Very Strong Monster"
304 "Hihihih I'm Very Strong Monster"
305 "Hihihih I'm Very Strong Monster"
306 "Hihihih I'm Very Strong Monster"
307 "Hihihih I'm Very Strong Monster"
308 "Hihihih I'm Very Strong Monster"
309 "Hihihih I'm Very Strong Monster"
310 "Hihihih I'm Very Strong Monster"
311 "Hihihih I'm Very Strong Monster"
312 "Hihihih I'm Very Strong Monster"
313 "Hihihih I'm Very Strong Monster"
314 "Hihihih I'm Very Strong Monster"
315 "Hihihih I'm Very Strong Monster"
316 "Hihihih I'm Very Strong Monster"
317 "Hihihih I'm Very Strong Monster"
318 "Hihihih I'm Very Strong Monster"
320 "Hihihih I'm Very Strong Monster"
321 "Hihihih I'm Very Strong Monster"
322 "Hihihih I'm Very Strong Monster"
323 "Hihihih I'm Very Strong Monster"
324 "Hihihih I'm Very Strong Monster"
325 "Hihihih I'm Very Strong Monster"
326 "Hihihih I'm Very Strong Monster"
327 "Hihihih I'm Very Strong Monster"
328 "Hihihih I'm Very Strong Monster"
329 "Hihihih I'm Very Strong Monster"
330 "Hihihih I'm Very Strong Monster"
331 "Hihihih I'm Very Strong Monster"
332 "Hihihih I'm Very Strong Monster"
333 "Hihihih I'm Very Strong Monster"
334 "Are You crazy !! You attack me"
335 "Are You crazy !! You attack me"
336 "Are You crazy !! You attack me"
337 "Are You crazy !! You attack me"
338 "Are You crazy !! You attack me"
339 "Are You crazy !! You attack me"
340 "Are You crazy !! You attack me"
341 "Are You crazy !! You attack me"
342 "Are You crazy !! You attack me"
343 "I'm Golden Moster You Are Dead"
344 "Are You crazy !! You attack me"
345 "Are You crazy !! You attack me"
346 "Are You crazy !! You attack me"
347 "Are You crazy !! You attack me"
348 "Are You crazy !! You attack me"
349 "Are You crazy !! You attack me"
350 "Are You crazy !! You attack me"
351 "Are You crazy !! You attack me"
352 "Are You crazy !! You attack me"
353 "I'm Golden Moster You Are Dead"
354 "I'm Golden Moster You Are Dead"
355 "Are You crazy !! You attack me"
356 "Are You crazy !! You attack me"
357 "Are You crazy !! You attack me"
358 "Are You crazy !! You attack me"
359 "Are You crazy !! You attack me"
360 "Are You crazy !! You attack me"
361 "Are You crazy !! You attack me"
362 "Are You crazy !! You attack me"
363 "Next time we do not approach"
364 "Next time we do not approach"
365 "Next time we do not approach"
366 "Next time we do not approach"
367 "Next time we do not approach"
368 "Next time we do not approach"
369 "Next time we do not approach"
370 "Next time we do not approach"
371 "Next time we do not approach"
372 "Next time we do not approach"
373 "Next time we do not approach"
374 "Next time we do not approach"
375 "Next time we do not approach"
376 "Next time we do not approach"
377 "Next time we do not approach"
378 "I'm Golden Moster You Are Dead"
379 "I'm Golden Moster You Are Dead"
380 "I'm Golden Moster You Are Dead"
381 "I'm Golden Moster You Are Dead"
382 "I'm Golden Moster You Are Dead"
383 "I'm Golden Moster You Are Dead"
384 "Now you will have a lesson"
385 "Now you will have a lesson"
386 "Now you will have a lesson"
387 "Now you will have a lesson"
388 "Now you will have a lesson"
389 "Now you will have a lesson"
390 "Now you will have a lesson"
391 "Now you will have a lesson"
392 "Now you will have a lesson"
393 "Now you will have a lesson"
394 "Now you will have a lesson"
395 "Now you will have a lesson"
396 "Now you will have a lesson"
397 "Now you will have a lesson"
398 "Now you will have a lesson"
399 "Now you will have a lesson"
400 "Now you will have a lesson"
401 "Now you will have a lesson"
402 "Now you will have a lesson"
403 "Now you will have a lesson"
404 "Now you will have a lesson"
405 "Now you will have a lesson"
406 "Now you will have a lesson"
407 "Now you will have a lesson"
408 "Now you will have a lesson"
409 "Now you will have a lesson"
410 "Now you will have a lesson"
411 "Now you will have a lesson"
412 "Now you will have a lesson"
413 "Now you will have a lesson"
414 "Now you will have a lesson"
415 "Now you will have a lesson"
416 "Now you will have a lesson"
417 "Now you will have a lesson"
418 "You Are Noob !!"
419 "You Are Noob !!"
420 "You Are Noob !!"
421 "You Are Noob !!"
422 "You Are Noob !!"
423 "You Are Noob !!"
424 "You Are Noob !!"
425 "You Are Noob !!"
426 "You Are Noob !!"
427 "You Are Noob !!"
428 "You Are Noob !!"
429 "You Are Noob !!"
430 "You Are Noob !!"
431 "You Are Noob !!"
432 "You Are Noob !!"
433 "You Are Noob !!"
434 "You Are Noob !!"
435 "You Are Noob !!"
436 "You Are Noob !!"
437 "You Are Noob !!"
438 "You Are Noob !!"
439 "You Are Noob !!"
440 "You Are Noob !!"
441 "You Are Noob !!"
442 "You Are Noob !!"
443 "You Are Noob !!"
444 "You Are Noob !!"
445 "You Are Noob !!"
446 "You Are Noob !!"
447 "You Are Noob !!"
448 "You Are Noob !!"
449 "You Are Noob !!"
450 "You Are Noob !!"
451 "Miss MIss , Come back later"
452 "Miss MIss , Come back later"
453 "Miss MIss , Come back later"
454 "Miss MIss , Come back later"
455 "Miss MIss , Come back later"
456 "Miss MIss , Come back later"
457 "Miss MIss , Come back later"
458 "Miss MIss , Come back later"
459 "Miss MIss , Come back later"
460 "Miss MIss , Come back later"
461 "Miss MIss , Come back later"
462 "Miss MIss , Come back later"
463 "Miss MIss , Come back later"
464 "Miss MIss , Come back later"
465 "Miss MIss , Come back later"
466 "Miss MIss , Come back later"
467 "Miss MIss , Come back later"
468 "Miss MIss , Come back later"
469 "Miss MIss , Come back later"
470 "Miss MIss , Come back later"
471 "Miss MIss , Come back later"
472 "Miss MIss , Come back later"
473 "Miss MIss , Come back later"
474 "Miss MIss , Come back later"
475 "Miss MIss , Come back later"
476 "Miss MIss , Come back later"
477 "Miss MIss , Come back later"
478 "Miss MIss , Come back later"
479 "Miss MIss , Come back later"
480 "Miss MIss , Come back later"
481 "Miss MIss , Come back later"
482 "Miss MIss , Come back later"
483 "Miss MIss , Come back later"
484 "Miss MIss , Come back later"
485 "Miss MIss , Come back later"
486 "Miss MIss , Come back later"
487 "Miss MIss , Come back later"
488 "Miss MIss , Come back later"
489 "Miss MIss , Come back later"
490 "Miss MIss , Come back later"
491 "I am the master and ruler"
492 "I am the master and ruler"
493 "I am the master and ruler"
494 "I am the master and ruler"
495 "I am the master and ruler"
496 "I am the master and ruler"
497 "I am the master and ruler"
498 "I am the master and ruler"
499 "I am the master and ruler"
500 "I am the master and ruler"
501 "Hihihih I'm Very Strong Monster"
502 "Hihihih I'm Very Strong Monster"
503 "Hihihih I'm Very Strong Monster"
504 "Hihihih I'm Very Strong Monster"
505 "Hihihih I'm Very Strong Monster"
506 "Hihihih I'm Very Strong Monster"
507 "Hihihih I'm Very Strong Monster"
508 "Hihihih I'm Very Strong Monster"
509 "Hihihih I'm Very Strong Monster"
510 "Hihihih I'm Very Strong Monster"
511 "Hihihih I'm Very Strong Monster"
512 "Hihihih I'm Very Strong Monster"
513 "Hihihih I'm Very Strong Monster"
514 "Hihihih I'm Very Strong Monster"
515 "Hihihih I'm Very Strong Monster"
516 "Hihihih I'm Very Strong Monster"
517 "Hihihih I'm Very Strong Monster"
518 "Hihihih I'm Very Strong Monster"
520 "Hihihih I'm Very Strong Monster"
521 "Hihihih I'm Very Strong Monster"
522 "Hihihih I'm Very Strong Monster"
523 "Hihihih I'm Very Strong Monster"
524 "Hihihih I'm Very Strong Monster"
525 "Hihihih I'm Very Strong Monster"
526 "Hihihih I'm Very Strong Monster"
527 "Hihihih I'm Very Strong Monster"
528 "Hihihih I'm Very Strong Monster"
529 "Hihihih I'm Very Strong Monster"
530 "Hihihih I'm Very Strong Monster"
531 "Hihihih I'm Very Strong Monster"
532 "Hihihih I'm Very Strong Monster"
533 "Hihihih I'm Very Strong Monster"
534 "Are You crazy !! You attack me"
535 "Are You crazy !! You attack me"
536 "Are You crazy !! You attack me"
537 "Are You crazy !! You attack me"
538 "Are You crazy !! You attack me"
539 "Are You crazy !! You attack me"
540 "Are You crazy !! You attack me"
541 "Are You crazy !! You attack me"
542 "Are You crazy !! You attack me"
543 "I'm Golden Moster You Are Dead"
544 "Are You crazy !! You attack me"
545 "Are You crazy !! You attack me"
546 "Are You crazy !! You attack me"
547 "Are You crazy !! You attack me"
548 "Are You crazy !! You attack me"
549 "Are You crazy !! You attack me"
550 "Are You crazy !! You attack me"
551 "Are You crazy !! You attack me"
552 "Are You crazy !! You attack me"
553 "I'm Golden Moster You Are Dead"
554 "I'm Golden Moster You Are Dead"
555 "Are You crazy !! You attack me"
556 "Are You crazy !! You attack me"
557 "Are You crazy !! You attack me"
558 "Are You crazy !! You attack me"
559 "Are You crazy !! You attack me"
560 "Are You crazy !! You attack me"
561 "Are You crazy !! You attack me"
562 "Are You crazy !! You attack me"
563 "Next time we do not approach"
564 "Next time we do not approach"
565 "Next time we do not approach"
566 "Next time we do not approach"
567 "Next time we do not approach"
568 "Next time we do not approach"
569 "Next time we do not approach"
570 "Next time we do not approach"
571 "Next time we do not approach"
572 "Next time we do not approach"
573 "Next time we do not approach"
574 "Next time we do not approach"
575 "Next time we do not approach"
576 "Next time we do not approach"
577 "Next time we do not approach"
578 "I'm Golden Moster You Are Dead"
579 "I'm Golden Moster You Are Dead"
end

CREDITOS diemorko

Gracias:


Offline sombe30 #2 on: April 06, 2017, 08:22:59 PM

  • 0 puntos por ventas
  • *
  • Rank: Avanzado
  • Posts: 140
  • Gracias recibida: 1225
  • cl
yo lo ise amigo compile y todo pero en los monster no sale el mensaje

Offline Ryuno #3 on: April 06, 2017, 11:15:45 PM

  • C++ Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 479
  • Gracias recibida: 1035
  • dz
yo lo ise amigo compile y todo pero en los monster no sale el mensaje

eso es porque lo andas adaptando mal. Funciona de 10. Recien probe.


Gracias:


Offline FBarbosa #4 on: April 06, 2017, 11:31:43 PM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 62
  • Gracias recibida: 2065
  • co
Yo no sé compilar podrían compartirlo compilado pleasee 😀

Offline sombe30 #5 on: April 06, 2017, 11:51:10 PM

  • 0 puntos por ventas
  • *
  • Rank: Avanzado
  • Posts: 140
  • Gracias recibida: 1225
  • cl
amigo podrias aportar la source aver donde para comparar y ver mi error

Offline siplhes #6 on: April 07, 2017, 05:45:35 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 28
  • Gracias recibida: 3
  • ve
exelente, que version de visual studios usas, o que IDE se podria usar
MuSky Season 6 - Maracaibo GameMaster - Siplhes

Offline Ryuno #7 on: April 07, 2017, 02:25:08 PM

  • C++ Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 479
  • Gracias recibida: 1035
  • dz
amigo podrias aportar la source aver donde para comparar y ver mi error
no ahi ningun error en el codigo solo es agregar el cpp y el header y agregar lo que sigue en la guia.

el visual studio que pueden usar es vs 2010 o  adaptar la fuente a vs 2015

Offline sombe30 #8 on: April 07, 2017, 02:27:33 PM

  • 0 puntos por ventas
  • *
  • Rank: Avanzado
  • Posts: 140
  • Gracias recibida: 1225
  • cl
ya lo ise amigo pero no sale el mensaje por eso pido la source para saver donde me quivoco

Offline Ryuno #9 on: April 07, 2017, 02:41:48 PM

  • C++ Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 479
  • Gracias recibida: 1035
  • dz
ya lo ise amigo pero no sale el mensaje por eso pido la source para saver donde me quivoco

la source del gameserver no la aportare porque es un proyecto privado mio. no tengo problema en explicar como se hace

1. Agregar los cpp y el header de la custom



2. abre el OBjectManager y agregar el siguiente if como la foto ( para colocarlo de forma exacta ahi esta el numero de la linea para que la coloques



3. Abre el ServerInfo.cpp
si o si nesesitaras esto ya que este se encargar de hacer lectura del archivo .txt de la custom




Creo que con esto te indica en donde colocar exactamente cada cosa de la custom , saludos.
« Ultima edicion: April 07, 2017, 02:44:00 PM by Ryuno »

Gracias:


Offline marianomarkoff #10 on: May 06, 2017, 09:21:04 PM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 78
  • Gracias recibida: 246
  • ar
Muchas gracias! tengo el siguiente problema amigos... hago todo tal y como explican pero.. al momento de entrar al server cuando pongo el servidor no aparece el "login" y se desconecta! ya le quite la licencia al gameserver no se que pasa
« Ultima edicion: May 06, 2017, 09:29:26 PM by marianomarkoff »

Offline Cacikus #11 on: May 06, 2017, 09:48:53 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 449
  • Gracias recibida: 4563
  • ve
Muchas gracias! tengo el siguiente problema amigos... hago todo tal y como explican pero.. al momento de entrar al server cuando pongo el servidor no aparece el "login" y se desconecta! ya le quite la licencia al gameserver no se que pasa

Pasa que también debes compilar el Main.dll y usar el main unpacked, si tienes más dudas crea un tema de soporte.

Offline marianomarkoff #12 on: May 06, 2017, 10:06:58 PM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 78
  • Gracias recibida: 246
  • ar
Muchas gracias! tengo el siguiente problema amigos... hago todo tal y como explican pero.. al momento de entrar al server cuando pongo el servidor no aparece el "login" y se desconecta! ya le quite la licencia al gameserver no se que pasa

Pasa que también debes compilar el Main.dll y usar el main unpacked, si tienes más dudas crea un tema de soporte.

Eso me dijeron pero.. donde encuentro en main.dll? o de donde lo genero? tengo el mainunpacked pero nose en que proyecto de los sources genero el main.dll

Offline Cacikus #13 on: May 06, 2017, 10:11:43 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 449
  • Gracias recibida: 4563
  • ve

Eso me dijeron pero.. donde encuentro en main.dll? o de donde lo genero? tengo el mainunpacked pero nose en que proyecto de los sources genero el main.dll

Te dije que si tenías más dudas crearás un tema de soporte, evita ser sancionado!

y el Main.dll lo compilas desde las sources, la que dice MAIN.

Offline kellviss20 #14 on: June 04, 2017, 08:54:58 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 2
  • Gracias recibida: 0
  • br


Agregue estas lineas en serverinfo.cpp
 
arriba
#include "CustomDeathMessage.h" 

y debajo de

in void CServerInfo::ReadCustomInfo() // OK 

Agregue

gCustomDeathMessage.Load(gPath.GetFullPath("Custom\\CustomDeathMessage.txt")); 

ObjectManager.cpp

#include "CustomDeathMessage.h" 

Debajo de
GCUserDieSend(lpTarget,lpTarget->Index,skill,lpObj->Index); 

Agregue
if(lpObj->Type == OBJECT_MONSTER) {
gCustomDeathMessage.GetDeathText(lpTarget,lpObj, lpObj->Class);
}




Code: [Select]
#pragma once

#include "Protocol.h"
#include "User.h"


struct CUSTOMDEATHMESSAGE_INFO
{
int Index;
char Text[128];
};


class CustomDeathMessage
{
public:
CustomDeathMessage();
virtual ~CustomDeathMessage();
void Load(char* path);
void GetDeathText(LPOBJ lpTarget, LPOBJ lpObj, int index);
bool GetInfo(int index,CUSTOMDEATHMESSAGE_INFO* lpInfo);
private:
std::map<int,CUSTOMDEATHMESSAGE_INFO> m_CustomDeathMessage;
};


extern CustomDeathMessage gCustomDeathMessage;


CustomDeathMessage.cpp


Code: [Select]
// CustomDeathMessage.cpp: implementation of the CGate class.//
//////////////////////////////////////////////////////////////////////


#include "stdafx.h"
#include "CommandManager.h"
#include "CustomDeathMessage.h"
#include "Log.h"
#include "MemScript.h"
#include "Message.h"
#include "Notice.h"
#include "Util.h"


CustomDeathMessage gCustomDeathMessage;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////


CustomDeathMessage::CustomDeathMessage() // OK
{
this->m_CustomDeathMessage.clear();
}


CustomDeathMessage::~CustomDeathMessage() // OK
{


}


void CustomDeathMessage::Load(char* path) // OK
{
CMemScript* lpMemScript = new CMemScript;


if(lpMemScript == 0)
{
ErrorMessageBox(MEM_SCRIPT_ALLOC_ERROR,path);
return;
}


if(lpMemScript->SetBuffer(path) == 0)
{
ErrorMessageBox(lpMemScript->GetLastError());
delete lpMemScript;
return;
}


this->m_CustomDeathMessage.clear();


try
{


while(true)
{


if(lpMemScript->GetToken() == TOKEN_END)
{
break;
}


if(strcmp("end",lpMemScript->GetString()) == 0)
{
break;
}


CUSTOMDEATHMESSAGE_INFO info;


info.Index = lpMemScript->GetNumber();


strcpy_s(info.Text,lpMemScript->GetAsString());


this->m_CustomDeathMessage.insert(std::pair<int,CUSTOMDEATHMESSAGE_INFO>(info.Index,info));
}
}
catch(...)
{
ErrorMessageBox(lpMemScript->GetLastError());
}


delete lpMemScript;
}




void CustomDeathMessage::GetDeathText(LPOBJ lpTarget, LPOBJ lpObj, int index) // OK
{
CUSTOMDEATHMESSAGE_INFO CustomDM;


if(this->GetInfo(index,&CustomDM) == 0)
{
return;
}


GCChatTargetSend(lpTarget,lpObj->Index,CustomDM.Text);
}




bool CustomDeathMessage::GetInfo(int index,CUSTOMDEATHMESSAGE_INFO* lpInfo) // OK
{
std::map<int,CUSTOMDEATHMESSAGE_INFO>::iterator it = this->m_CustomDeathMessage.find(index);


if(it == this->m_CustomDeathMessage.end())
{
return 0;
}
else
{
(*lpInfo) = it->second;
return 1;
}
}

Agregar txt creado en Data/Custom:
CustomDeathMessage.txt

olá amigo boa noite gostaria de saber se vc poderia libera as filer desses arquivos pois não estou conseguindo adicionar na minha sourcer

Offline pquintal #15 on: August 15, 2017, 08:41:57 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 8
  • Gracias recibida: 26
  • ve


Agregue estas lineas en serverinfo.cpp
 
arriba
#include "CustomDeathMessage.h" 

y debajo de

in void CServerInfo::ReadCustomInfo() // OK 

Agregue

gCustomDeathMessage.Load(gPath.GetFullPath("Custom\\CustomDeathMessage.txt")); 

ObjectManager.cpp

#include "CustomDeathMessage.h" 

Debajo de
GCUserDieSend(lpTarget,lpTarget->Index,skill,lpObj->Index); 

Agregue
if(lpObj->Type == OBJECT_MONSTER) {
gCustomDeathMessage.GetDeathText(lpTarget,lpObj, lpObj->Class);
}




Code: [Select]
#pragma once

#include "Protocol.h"
#include "User.h"


struct CUSTOMDEATHMESSAGE_INFO
{
int Index;
char Text[128];
};


class CustomDeathMessage
{
public:
CustomDeathMessage();
virtual ~CustomDeathMessage();
void Load(char* path);
void GetDeathText(LPOBJ lpTarget, LPOBJ lpObj, int index);
bool GetInfo(int index,CUSTOMDEATHMESSAGE_INFO* lpInfo);
private:
std::map<int,CUSTOMDEATHMESSAGE_INFO> m_CustomDeathMessage;
};


extern CustomDeathMessage gCustomDeathMessage;


CustomDeathMessage.cpp


Code: [Select]
// CustomDeathMessage.cpp: implementation of the CGate class.//
//////////////////////////////////////////////////////////////////////


#include "stdafx.h"
#include "CommandManager.h"
#include "CustomDeathMessage.h"
#include "Log.h"
#include "MemScript.h"
#include "Message.h"
#include "Notice.h"
#include "Util.h"


CustomDeathMessage gCustomDeathMessage;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////


CustomDeathMessage::CustomDeathMessage() // OK
{
this->m_CustomDeathMessage.clear();
}


CustomDeathMessage::~CustomDeathMessage() // OK
{


}


void CustomDeathMessage::Load(char* path) // OK
{
CMemScript* lpMemScript = new CMemScript;


if(lpMemScript == 0)
{
ErrorMessageBox(MEM_SCRIPT_ALLOC_ERROR,path);
return;
}


if(lpMemScript->SetBuffer(path) == 0)
{
ErrorMessageBox(lpMemScript->GetLastError());
delete lpMemScript;
return;
}


this->m_CustomDeathMessage.clear();


try
{


while(true)
{


if(lpMemScript->GetToken() == TOKEN_END)
{
break;
}


if(strcmp("end",lpMemScript->GetString()) == 0)
{
break;
}


CUSTOMDEATHMESSAGE_INFO info;


info.Index = lpMemScript->GetNumber();


strcpy_s(info.Text,lpMemScript->GetAsString());


this->m_CustomDeathMessage.insert(std::pair<int,CUSTOMDEATHMESSAGE_INFO>(info.Index,info));
}
}
catch(...)
{
ErrorMessageBox(lpMemScript->GetLastError());
}


delete lpMemScript;
}




void CustomDeathMessage::GetDeathText(LPOBJ lpTarget, LPOBJ lpObj, int index) // OK
{
CUSTOMDEATHMESSAGE_INFO CustomDM;


if(this->GetInfo(index,&CustomDM) == 0)
{
return;
}


GCChatTargetSend(lpTarget,lpObj->Index,CustomDM.Text);
}




bool CustomDeathMessage::GetInfo(int index,CUSTOMDEATHMESSAGE_INFO* lpInfo) // OK
{
std::map<int,CUSTOMDEATHMESSAGE_INFO>::iterator it = this->m_CustomDeathMessage.find(index);


if(it == this->m_CustomDeathMessage.end())
{
return 0;
}
else
{
(*lpInfo) = it->second;
return 1;
}
}

Agregar txt creado en Data/Custom:
CustomDeathMessage.txt

Funciona de 10, ahi te deje las gracias

Gracias:


Offline inax123 #16 on: January 19, 2018, 07:14:59 PM

  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 196
  • Gracias recibida: 856
  • ar

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
594 Views
Last post October 20, 2017, 10:57:53 AM
by darkroh
2 Replies
701 Views
Last post December 29, 2016, 11:40:11 AM
by MonicaCisneros
2 Replies
518 Views
Last post March 15, 2017, 08:35:09 PM
by ratza2003
9 Replies
965 Views
Last post June 13, 2017, 07:24:50 PM
by d3llam3a
17 Replies
944 Views
Last post May 05, 2017, 02:37:02 AM
by Xysad