[8.1][C++] OnDiePlayer

 
Tibia.net.pl

Wróć   Tibia.net.pl > OpenTibia > Skrypty - pozostałe > C++

#2 event Tibia.net.pl: Kończymy rozgrzewkę! (Start - Sobota, godz. 17:00) Big meeting (22 listopada, Poznań)


  Tibia.net.pl (#?)
[8.1][C++] OnDiePlayer

Dyskusja dotycząca tematu [8.1][C++] OnDiePlayer, który znajduje się w kategorii Skrypty - pozostałe (Pomoc oraz inne skrypty związane z OT.), na forum C++ (Wszystko, co związane z kompilowaniem.). Treść: Znalazłem kod c++ "OnDiePlayer". Jest on oparty na funkcji "onDie". Nie dotyczy potworów, lecz playerów. Zaczynajmy: w pliku creature.cpp pod: Kod: ...


Odpowiedz
 
15-08-2008, 13:38  
Gaduła
 
Użytkownik Banco Rozbujca na Tibia.net.pl

[8.1][C++] OnDiePlayer


Znalazłem kod c++ "OnDiePlayer". Jest on oparty na funkcji "onDie". Nie dotyczy potworów, lecz playerów.

Zaczynajmy:

w pliku creature.cpp pod:
Kod:
//scripting event - onDie
CreatureEvent* eventDie = getCreatureEvent(CREATURE_EVENT_DIE);
if(eventDie){
eventDie->executeOnDie(this, corpse);
}
dodajemy:
Kod:
#ifdef ON_PLAYER_DIE_DZOJO    
    if(this->getPlayer()){
         g_creatureEvents->playerDie(this->getPlayer(), corpse);
    }
#endif
Otwieramy plik creatureevent.cpp :

Pod:
Kod:
m_logOutEvent = NULL;
Dodajemy:
Kod:
#ifdef ON_PLAYER_DIE_DZOJO    
    m_playerDieEvent = NULL;
#endif
następnie pod:
Kod:
delete m_logOutEvent;
Wstawiamy:
Kod:
#ifdef ON_PLAYER_DIE_DZOJO    
    delete m_playerDieEvent;
#endif
Pod:
Kod:
case CREATURE_EVENT_LOGOUT:
delete m_logOutEvent;
m_logOutEvent = creatureEvent;
return true;
Dajemy:
Kod:
#ifdef ON_PLAYER_DIE_DZOJO        
    case CREATURE_EVENT_DIE_PLAYER:
        delete m_playerDieEvent;
        m_playerDieEvent = creatureEvent;
        return true;
#endif
Nad tym:
Kod:
uint32_t CreatureEvents::playerLogOut(Player* player)
{
// fire global event if is registered
if(m_logOutEvent){
return m_logOutEvent->executeOnLogout(player);
}
return 0;
}
Wpisujemy to:
Kod:
#ifdef ON_PLAYER_DIE_DZOJO    
uint32_t CreatureEvents::playerDie(Player* player, Item* corpse)
{
    // fire global event if is registered
    if(m_playerDieEvent){
        return m_playerDieEvent->executeOnDiePlayer(player, corpse);
    }
        return 0;
    }    
#endif
Pod:"
Kod:
else if(str == "die"){
m_type = CREATURE_EVENT_DIE;
}
Dajemy:
Kod PHP:
#ifdef ON_PLAYER_DIE_DZOJO        
        
else if(str == "dieplayer"){
            
m_type CREATURE_EVENT_DIE_PLAYER;
        }
#endif 
Poniżej:
Kod:
case CREATURE_EVENT_DIE:
return "onDie";
break;
Wpisujemy:
Kod PHP:
#ifdef ON_PLAYER_DIE_DZOJO        
    
case CREATURE_EVENT_DIE_PLAYER:
        return 
"onDiePlayer";
        break;
#endif 
Teraz zajmiemy się plikiem creatureevent.h:

Pod:
Kod:
uint32_t playerLogOut(Player* player);
Dodajemy:
Kod PHP:
#ifdef ON_PLAYER_DIE_DZOJO    
    
uint32_t playerDie(PlayerplayerItemcorpse);
#endif 
Poniżej:
Kod:
uint32_t executeOnDie(Creature* creature, Item* corpse);
Dodajemy:
Kod PHP:
#ifdef ON_PLAYER_DIE_DZOJO    
    
uint32_t executeOnDiePlayer(PlayerplayerItemcorpse);
#endif 
Pod:
Kod:
CreatureEvent* m_logOutEvent;
Dodajemy:
Kod PHP:
#ifdef ON_PLAYER_DIE_DZOJO       
    
CreatureEventm_playerDieEvent;
#endif 
Poniżej:
Kod:
CREATURE_EVENT_DIE,
Wklejamy:
Kod PHP:
#ifdef ON_PLAYER_DIE_DZOJO
    
CREATURE_EVENT_DIE_PLAYER,
#endif 

No to już wszystko, teraz tylko musimy wejść w opcje projektu i wkleić to:
Kod:
-DON_PLAYER_DIE_DZOJO

Pozdrawiam,
Banco Rozbujca
 


15-08-2008, 14:16  
Ekspert

Możesz bardziej objaśnić o co chodzi w tym skrypcie??

Dodaje jakąś fukcje OnDie? Ale po co? ...
 
15-08-2008, 15:12  
Fanatyk
 
Użytkownik T O M E K na Tibia.net.pl

@up
Dzięki tej funkcji możesz np zrobić że jak padniesz to w dedzie masz kość mózg lub inny item i na niej piszą twoje dane czyli nick itd
@topic
stary skrypt ale nie było go tu więc dobrze ż go dodałeś
 
05-10-2008, 10:30  
Nowicjusz
 
Użytkownik Zexarm na Tibia.net.pl

Odp: [8.1][C++] OnDiePlayer


Taki podobny scrypt jest na Stigma Ots 8.1 że jak padniesz to w dedzie jest serce i pisze : (nick) zmarł na (lvl postaci) przez (nick zabujcy,albo nazwa potwora)
 
05-10-2008, 10:32  
Nowicjusz

Odp: [8.1][C++] OnDiePlayer


onDie/onDeath jest teraz w każdym engine, dlatego nie rozumiem po co taki kod
 
01-11-2008, 18:34  
Bywalec

Odp: [8.1][C++] OnDiePlayer


jakbyś mógł to podaj całość skryptu bo ja nie mam tej wersji
Cytat:
//scripting event - onDie
CreatureEvent* eventDie = getCreatureEvent(CREATURE_EVENT_DIE);
if(eventDie){
eventDie->executeOnDie(this, corpse);
}
 


Odpowiedz

Narzędzia tematu
Wygląd

Tibia.net.pl: C++ (Wszystko, co związane z kompilowaniem.)
Temat: [8.1][C++] OnDiePlayer Znalazłem kod c++ "OnDiePlayer". Jest on oparty na funkcji "onDie". [...]


[C++] Kompilowanie Ots na Maca (*.exe na Maca) - johny5608 (0) 20-11-2008 21:09 Zanim spytasz w temacie - wpadnij tu! - Aleq (0) 17-11-2008 16:25 Auto balance team 7.6 - Pawcio. (0) 17-11-2008 15:03 Devland 8.1 HELP! - Mzikos (2) 15-11-2008 10:03 [-8.1] Priv NPC by Aragorn - Aragornkk (3) 18-11-2008 17:32 Sucre evolution [8.0] - jinn (0) 31-10-2008 16:41 [C++] GM pisze zawsze na czerwono - schikell (1) 05-10-2008 10:34 [C++] Komenda /giveskill - schikell (3) 30-09-2008 21:00 [7.6] - mati504 (0) 29-09-2008 20:28 [8.2+]Attack speed - fabian766 (0) 21-09-2008 12:21


Czasy w strefie GMT +1. Teraz jest 13:30.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.2.0 © 2008, Crawlability, Inc.