Assembla home | Assembla project page
 

Changeset 910

Show
Ignore:
Timestamp:
11/06/08 23:28:50 (8 months ago)
Author:
Ramsey
Message:

added hardcoded mission "The Box". If the TC doesn't crash while players run this mission, the rest of the mission features can be rolled out. Added enough to test for crashes. ty David Karivalis for helping with testing. Known missing features: Mission saving isn't committed so this can be ran multiple times on relog, packet bug with mission titles, mission waypoint missing (migrating from normal waypoints to the actual waypoint setting in MISO packets).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • core3/trunk/MMOCoreORB/build/unix/Makefile

    r904 r910  
    117117distuninstallcheck_listfiles = find . -type f -print 
    118118distcleancheck_listfiles = find . -type f -print 
    119 ACLOCAL = ${SHELL} /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/config/missing --run aclocal-1.10 
    120 AMTAR = ${SHELL} /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/config/missing --run tar 
    121 AUTOCONF = ${SHELL} /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/config/missing --run autoconf 
    122 AUTOHEADER = ${SHELL} /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/config/missing --run autoheader 
    123 AUTOMAKE = ${SHELL} /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/config/missing --run automake-1.10 
     119ACLOCAL = ${SHELL} /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/config/missing --run aclocal-1.10 
     120AMTAR = ${SHELL} /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/config/missing --run tar 
     121AUTOCONF = ${SHELL} /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/config/missing --run autoconf 
     122AUTOHEADER = ${SHELL} /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/config/missing --run autoheader 
     123AUTOMAKE = ${SHELL} /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/config/missing --run automake-1.10 
    124124AWK = gawk 
    125125CC = gcc 
     
    146146LIBS =  
    147147LTLIBOBJS =  
    148 MAKEINFO = ${SHELL} /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/config/missing --run makeinfo 
     148MAKEINFO = ${SHELL} /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/config/missing --run makeinfo 
    149149MKDIR_P = /usr/bin/mkdir -p 
    150150OBJEXT = o 
     
    165165USER_LIBS_PATH = /usr/local/lib 
    166166VERSION = 1.0 
    167 abs_builddir = /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix 
    168 abs_srcdir = /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/../.. 
    169 abs_top_builddir = /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix 
    170 abs_top_srcdir = /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/../.. 
     167abs_builddir = /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix 
     168abs_srcdir = /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/../.. 
     169abs_top_builddir = /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix 
     170abs_top_srcdir = /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/../.. 
    171171ac_ct_CC = gcc 
    172172ac_ct_CXX = g++ 
     
    196196includedir = ${prefix}/include 
    197197infodir = ${datarootdir}/info 
    198 install_sh = $(SHELL) /cygdrive/c/SWGEmu/workspace/MMOCoreORB/build/unix/config/install-sh 
     198install_sh = $(SHELL) /cygdrive/c/Work/SWGEmu/liveWorkspace/MMOCoreORB/build/unix/config/install-sh 
    199199libdir = ${exec_prefix}/lib 
    200200libexecdir = ${exec_prefix}/libexec 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/creature/CreatureManager.cpp

    r764 r910  
    1919#include "../../objects/creature/action/ActionCreature.h" 
    2020 
    21 #include "../../objects/creature/action/Action.h" 
    22  
    2321#include "../../objects/creature/trainer/TrainerCreature.h" 
    2422 
     
    127125} 
    128126 
    129 void CreatureManager::loadMissionCreatures() { 
     127void CreatureManager::load(Creature* creature) { 
    130128        if (_impl == NULL) { 
    131129                if (!deployed) 
     
    133131 
    134132                DistributedMethod method(this, 13); 
    135  
    136                 method.executeWithVoidReturn(); 
    137         } else 
    138                 ((CreatureManagerImplementation*) _impl)->loadMissionCreatures(); 
    139 
    140  
    141 void CreatureManager::load(Creature* creature) { 
     133                method.addObjectParameter(creature); 
     134 
     135                method.executeWithVoidReturn(); 
     136        } else 
     137                ((CreatureManagerImplementation*) _impl)->load(creature); 
     138
     139 
     140void CreatureManager::unloadCreature(Creature* creature) { 
    142141        if (_impl == NULL) { 
    143142                if (!deployed) 
     
    149148                method.executeWithVoidReturn(); 
    150149        } else 
    151                 ((CreatureManagerImplementation*) _impl)->load(creature); 
    152 } 
    153  
    154 void CreatureManager::unloadCreature(Creature* creature) { 
     150                ((CreatureManagerImplementation*) _impl)->unloadCreature(creature); 
     151} 
     152 
     153bool CreatureManager::verifyCreatureSpawn(string& name) { 
    155154        if (_impl == NULL) { 
    156155                if (!deployed) 
     
    158157 
    159158                DistributedMethod method(this, 15); 
    160                 method.addObjectParameter(creature); 
    161  
    162                 method.executeWithVoidReturn(); 
    163         } else 
    164                 ((CreatureManagerImplementation*) _impl)->unloadCreature(creature); 
    165 } 
    166  
    167 bool CreatureManager::verifyCreatureSpawn(string& name) { 
     159                method.addAsciiParameter(name); 
     160 
     161                return method.executeWithBooleanReturn(); 
     162        } else 
     163                return ((CreatureManagerImplementation*) _impl)->verifyCreatureSpawn(name); 
     164} 
     165 
     166Creature* CreatureManager::spawnCreature(unsigned int objcrc, unsigned long long cellid, float x, float y, int bitmask, bool baby, bool doLock, float height) { 
    168167        if (_impl == NULL) { 
    169168                if (!deployed) 
     
    171170 
    172171                DistributedMethod method(this, 16); 
    173                 method.addAsciiParameter(name); 
    174  
    175                 return method.executeWithBooleanReturn(); 
    176         } else 
    177                 return ((CreatureManagerImplementation*) _impl)->verifyCreatureSpawn(name); 
    178 } 
    179  
    180 Creature* CreatureManager::spawnCreature(unsigned int objcrc, unsigned long long cellid, float x, float y, int bitmask, bool baby, bool doLock, float height) { 
    181         if (_impl == NULL) { 
    182                 if (!deployed) 
    183                         throw ObjectNotDeployedException(this); 
    184  
    185                 DistributedMethod method(this, 17); 
    186172                method.addUnsignedIntParameter(objcrc); 
    187173                method.addUnsignedLongParameter(cellid); 
     
    203189                        throw ObjectNotDeployedException(this); 
    204190 
    205                 DistributedMethod method(this, 18); 
     191                DistributedMethod method(this, 17); 
    206192                method.addAsciiParameter(profession); 
    207193                method.addAsciiParameter(stfname); 
     
    226212                        throw ObjectNotDeployedException(this); 
    227213 
    228                 DistributedMethod method(this, 19); 
     214                DistributedMethod method(this, 18); 
    229215                method.addAsciiParameter(Planet); 
    230216                method.addAsciiParameter(City); 
     
    248234                        throw ObjectNotDeployedException(this); 
    249235 
    250                 DistributedMethod method(this, 20); 
     236                DistributedMethod method(this, 19); 
    251237                method.addFloatParameter(x); 
    252238                method.addFloatParameter(y); 
     
    267253                        throw ObjectNotDeployedException(this); 
    268254 
    269                 DistributedMethod method(this, 21); 
     255                DistributedMethod method(this, 20); 
    270256                method.addAsciiParameter(type); 
    271257                method.addFloatParameter(x); 
     
    279265} 
    280266 
    281 ActionCreature* CreatureManager::spawnActionCreature(string& name, string& stfname, unsigned int objCrc, string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid, bool doLock) { 
    282         if (_impl == NULL) { 
    283                 if (!deployed) 
    284                         throw ObjectNotDeployedException(this); 
    285  
    286                 DistributedMethod method(this, 22); 
     267ActionCreature* CreatureManager::spawnActionCreature(string& name, string& stfname, unsigned int objCrc, const string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid, bool doLock) { 
     268        if (_impl == NULL) { 
     269                if (!deployed) 
     270                        throw ObjectNotDeployedException(this); 
     271 
     272                DistributedMethod method(this, 21); 
    287273                method.addAsciiParameter(name); 
    288274                method.addAsciiParameter(stfname); 
     
    306292                        throw ObjectNotDeployedException(this); 
    307293 
     294                DistributedMethod method(this, 22); 
     295                method.addAsciiParameter(name); 
     296 
     297                return method.executeWithUnsignedIntReturn(); 
     298        } else 
     299                return ((CreatureManagerImplementation*) _impl)->getCreatureCrc(name); 
     300} 
     301 
     302bool CreatureManager::hotLoadCreature(string& name) { 
     303        if (_impl == NULL) { 
     304                if (!deployed) 
     305                        throw ObjectNotDeployedException(this); 
     306 
    308307                DistributedMethod method(this, 23); 
    309308                method.addAsciiParameter(name); 
    310309 
    311                 return method.executeWithUnsignedIntReturn(); 
    312         } else 
    313                 return ((CreatureManagerImplementation*) _impl)->getCreatureCrc(name); 
    314 } 
    315  
    316 bool CreatureManager::hotLoadCreature(string& name) { 
     310                return method.executeWithBooleanReturn(); 
     311        } else 
     312                return ((CreatureManagerImplementation*) _impl)->hotLoadCreature(name); 
     313} 
     314 
     315void CreatureManager::registerFunctions() { 
    317316        if (_impl == NULL) { 
    318317                if (!deployed) 
     
    320319 
    321320                DistributedMethod method(this, 24); 
    322                 method.addAsciiParameter(name); 
    323  
    324                 return method.executeWithBooleanReturn(); 
    325         } else 
    326                 return ((CreatureManagerImplementation*) _impl)->hotLoadCreature(name); 
    327 
    328  
    329 void CreatureManager::registerFunctions() { 
     321 
     322                method.executeWithVoidReturn(); 
     323        } else 
     324                ((CreatureManagerImplementation*) _impl)->registerFunctions(); 
     325
     326 
     327void CreatureManager::registerGlobals() { 
    330328        if (_impl == NULL) { 
    331329                if (!deployed) 
     
    336334                method.executeWithVoidReturn(); 
    337335        } else 
    338                 ((CreatureManagerImplementation*) _impl)->registerFunctions(); 
    339 } 
    340  
    341 void CreatureManager::registerGlobals() { 
     336                ((CreatureManagerImplementation*) _impl)->registerGlobals(); 
     337} 
     338 
     339void CreatureManager::loadCreatureFile() { 
    342340        if (_impl == NULL) { 
    343341                if (!deployed) 
     
    348346                method.executeWithVoidReturn(); 
    349347        } else 
    350                 ((CreatureManagerImplementation*) _impl)->registerGlobals(); 
    351 } 
    352  
    353 void CreatureManager::loadCreatureFile() { 
     348                ((CreatureManagerImplementation*) _impl)->loadCreatureFile(); 
     349} 
     350 
     351Creature* CreatureManager::getCreature(unsigned long long oid) { 
    354352        if (_impl == NULL) { 
    355353                if (!deployed) 
     
    357355 
    358356                DistributedMethod method(this, 27); 
    359  
    360                 method.executeWithVoidReturn(); 
    361         } else 
    362                 ((CreatureManagerImplementation*) _impl)->loadCreatureFile(); 
    363 
    364  
    365 Creature* CreatureManager::getCreature(unsigned long long oid) { 
     357                method.addUnsignedLongParameter(oid); 
     358 
     359                return (Creature*) method.executeWithObjectReturn(); 
     360        } else 
     361                return ((CreatureManagerImplementation*) _impl)->getCreature(oid); 
     362
     363 
     364void CreatureManager::addCreature(Creature* creature) { 
    366365        if (_impl == NULL) { 
    367366                if (!deployed) 
     
    369368 
    370369                DistributedMethod method(this, 28); 
    371                 method.addUnsignedLongParameter(oid); 
    372  
    373                 return (Creature*) method.executeWithObjectReturn(); 
    374         } else 
    375                 return ((CreatureManagerImplementation*) _impl)->getCreature(oid); 
    376 } 
    377  
    378 void CreatureManager::addCreature(Creature* creature) { 
    379         if (_impl == NULL) { 
    380                 if (!deployed) 
    381                         throw ObjectNotDeployedException(this); 
    382  
    383                 DistributedMethod method(this, 29); 
    384370                method.addObjectParameter(creature); 
    385371 
     
    422408                break; 
    423409        case 13: 
    424                 loadMissionCreatures(); 
     410                load((Creature*) inv->getObjectParameter()); 
    425411                break; 
    426412        case 14: 
    427                 load((Creature*) inv->getObjectParameter()); 
     413                unloadCreature((Creature*) inv->getObjectParameter()); 
    428414                break; 
    429415        case 15: 
    430                 unloadCreature((Creature*) inv->getObjectParameter()); 
     416                resp->insertBoolean(verifyCreatureSpawn(inv->getAsciiParameter(_param0_verifyCreatureSpawn__string_))); 
    431417                break; 
    432418        case 16: 
    433                 resp->insertBoolean(verifyCreatureSpawn(inv->getAsciiParameter(_param0_verifyCreatureSpawn__string_))); 
     419                resp->insertLong(spawnCreature(inv->getUnsignedIntParameter(), inv->getUnsignedLongParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getSignedIntParameter(), inv->getBooleanParameter(), inv->getBooleanParameter(), inv->getFloatParameter())->_getObjectID()); 
    434420                break; 
    435421        case 17: 
    436                 resp->insertLong(spawnCreature(inv->getUnsignedIntParameter(), inv->getUnsignedLongParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getSignedIntParameter(), inv->getBooleanParameter(), inv->getBooleanParameter(), inv->getFloatParameter())->_getObjectID()); 
     422                resp->insertLong(spawnTrainer(inv->getAsciiParameter(_param0_spawnTrainer__string_string_string_int_long_float_float_float_float_float_bool_), inv->getAsciiParameter(_param1_spawnTrainer__string_string_string_int_long_float_float_float_float_float_bool_), inv->getAsciiParameter(_param2_spawnTrainer__string_string_string_int_long_float_float_float_float_float_bool_), inv->getSignedIntParameter(), inv->getUnsignedLongParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getBooleanParameter())->_getObjectID()); 
    437423                break; 
    438424        case 18: 
    439                 resp->insertLong(spawnTrainer(inv->getAsciiParameter(_param0_spawnTrainer__string_string_string_int_long_float_float_float_float_float_bool_), inv->getAsciiParameter(_param1_spawnTrainer__string_string_string_int_long_float_float_float_float_float_bool_), inv->getAsciiParameter(_param2_spawnTrainer__string_string_string_int_long_float_float_float_float_float_bool_), inv->getSignedIntParameter(), inv->getUnsignedLongParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getBooleanParameter())->_getObjectID()); 
     425                resp->insertLong(spawnShuttle(inv->getAsciiParameter(_param0_spawnShuttle__string_string_Coordinate_long_float_float_float_int_bool_bool_), inv->getAsciiParameter(_param1_spawnShuttle__string_string_Coordinate_long_float_float_float_int_bool_bool_), (Coordinate*) inv->getObjectParameter(), inv->getUnsignedLongParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getSignedIntParameter(), inv->getBooleanParameter(), inv->getBooleanParameter())->_getObjectID()); 
    440426                break; 
    441427        case 19: 
    442                 resp->insertLong(spawnShuttle(inv->getAsciiParameter(_param0_spawnShuttle__string_string_Coordinate_long_float_float_float_int_bool_bool_), inv->getAsciiParameter(_param1_spawnShuttle__string_string_Coordinate_long_float_float_float_int_bool_bool_), (Coordinate*) inv->getObjectParameter(), inv->getUnsignedLongParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getSignedIntParameter(), inv->getBooleanParameter(), inv->getBooleanParameter())->_getObjectID()); 
     428                resp->insertLong(spawnRecruiter(inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getUnsignedCharParameter(), inv->getUnsignedLongParameter(), inv->getBooleanParameter())->_getObjectID()); 
    443429                break; 
    444430        case 20: 
    445                 resp->insertLong(spawnRecruiter(inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getUnsignedCharParameter(), inv->getUnsignedLongParameter(), inv->getBooleanParameter())->_getObjectID()); 
     431                resp->insertLong(spawnLair(inv->getAsciiParameter(_param0_spawnLair__string_float_float_float_bool_), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getBooleanParameter())->_getObjectID()); 
    446432                break; 
    447433        case 21: 
    448                 resp->insertLong(spawnLair(inv->getAsciiParameter(_param0_spawnLair__string_float_float_float_bool_), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getBooleanParameter())->_getObjectID()); 
     434                resp->insertLong(spawnActionCreature(inv->getAsciiParameter(_param0_spawnActionCreature__string_string_int_string_float_float_float_float_long_bool_), inv->getAsciiParameter(_param1_spawnActionCreature__string_string_int_string_float_float_float_float_long_bool_), inv->getUnsignedIntParameter(), inv->getAsciiParameter(_param3_spawnActionCreature__string_string_int_string_float_float_float_float_long_bool_), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getUnsignedLongParameter(), inv->getBooleanParameter())->_getObjectID()); 
    449435                break; 
    450436        case 22: 
    451                 resp->insertLong(spawnActionCreature(inv->getAsciiParameter(_param0_spawnActionCreature__string_string_int_string_float_float_float_float_long_bool_), inv->getAsciiParameter(_param1_spawnActionCreature__string_string_int_string_float_float_float_float_long_bool_), inv->getUnsignedIntParameter(), inv->getAsciiParameter(_param3_spawnActionCreature__string_string_int_string_float_float_float_float_long_bool_), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), inv->getUnsignedLongParameter(), inv->getBooleanParameter())->_getObjectID()); 
     437                resp->insertInt(getCreatureCrc(inv->getAsciiParameter(_param0_getCreatureCrc__string_))); 
    452438                break; 
    453439        case 23: 
    454                 resp->insertInt(getCreatureCrc(inv->getAsciiParameter(_param0_getCreatureCrc__string_))); 
     440                resp->insertBoolean(hotLoadCreature(inv->getAsciiParameter(_param0_hotLoadCreature__string_))); 
    455441                break; 
    456442        case 24: 
    457                 resp->insertBoolean(hotLoadCreature(inv->getAsciiParameter(_param0_hotLoadCreature__string_))); 
     443                registerFunctions(); 
    458444                break; 
    459445        case 25: 
    460                 registerFunctions(); 
     446                registerGlobals(); 
    461447                break; 
    462448        case 26: 
    463                 registerGlobals(); 
     449                loadCreatureFile(); 
    464450                break; 
    465451        case 27: 
    466                 loadCreatureFile(); 
     452                resp->insertLong(getCreature(inv->getUnsignedLongParameter())->_getObjectID()); 
    467453                break; 
    468454        case 28: 
    469                 resp->insertLong(getCreature(inv->getUnsignedLongParameter())->_getObjectID()); 
    470                 break; 
    471         case 29: 
    472455                addCreature((Creature*) inv->getObjectParameter()); 
    473456                break; 
     
    507490} 
    508491 
    509 void CreatureManagerAdapter::loadMissionCreatures() { 
    510         return ((CreatureManagerImplementation*) impl)->loadMissionCreatures(); 
    511 } 
    512  
    513492void CreatureManagerAdapter::load(Creature* creature) { 
    514493        return ((CreatureManagerImplementation*) impl)->load(creature); 
     
    543522} 
    544523 
    545 ActionCreature* CreatureManagerAdapter::spawnActionCreature(string& name, string& stfname, unsigned int objCrc, string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid, bool doLock) { 
     524ActionCreature* CreatureManagerAdapter::spawnActionCreature(string& name, string& stfname, unsigned int objCrc, const string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid, bool doLock) { 
    546525        return ((CreatureManagerImplementation*) impl)->spawnActionCreature(name, stfname, objCrc, misoKey, x, y, oY, oW, cellid, doLock); 
    547526} 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/creature/CreatureManager.h

    r764 r910  
    2424class ActionCreature; 
    2525 
    26 class Action; 
    27  
    2826class TrainerCreature; 
    2927 
     
    5048        void loadBlueFrogs(); 
    5149 
    52         void loadMissionCreatures(); 
    53  
    5450        void load(Creature* creature); 
    5551 
     
    6864        LairObject* spawnLair(const string& type, float x, float y, float z, bool doLock = true); 
    6965 
    70         ActionCreature* spawnActionCreature(string& name, string& stfname, unsigned int objCrc, string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid = 0, bool doLock = true); 
     66        ActionCreature* spawnActionCreature(string& name, string& stfname, unsigned int objCrc, const string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid = 0, bool doLock = true); 
    7167 
    7268        unsigned int getCreatureCrc(string& name); 
     
    114110        void loadBlueFrogs(); 
    115111 
    116         void loadMissionCreatures(); 
    117  
    118112        void load(Creature* creature); 
    119113 
     
    132126        LairObject* spawnLair(const string& type, float x, float y, float z, bool doLock); 
    133127 
    134         ActionCreature* spawnActionCreature(string& name, string& stfname, unsigned int objCrc, string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid, bool doLock); 
     128        ActionCreature* spawnActionCreature(string& name, string& stfname, unsigned int objCrc, const string& misoKey, float x, float y, float oY, float oW, unsigned long long cellid, bool doLock); 
    135129 
    136130        unsigned int getCreatureCrc(string& name); 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/creature/CreatureManager.idl

    r764 r910  
    5454 
    5555import "../../objects/creature/action/ActionCreature"; 
    56 import "../../objects/creature/action/Action"; 
    5756import "../../objects/creature/trainer/TrainerCreature"; 
    5857import "../../objects/creature/recruiter/RecruiterCreature"; 
     
    7675        void loadRecruiters(); 
    7776        void loadBlueFrogs(); 
    78         void loadMissionCreatures(); 
    7977 
    8078        void load(Creature creature); 
     
    8987        RecruiterCreature spawnRecruiter(float x, float y, float oY, float oW, unsigned char type = 1, unsigned long cellid = 0, boolean doLock = true); 
    9088        LairObject spawnLair(const string type, float x, float y, float z, boolean doLock = true); 
    91         ActionCreature spawnActionCreature(string name, string stfname, unsigned int objCrc, string misoKey, float x, float y, float oY, float oW, unsigned long cellid = 0, boolean doLock = true); 
     89        ActionCreature spawnActionCreature(string name, string stfname, unsigned int objCrc, const string misoKey, float x, float y, float oY, float oW, unsigned long cellid = 0, boolean doLock = true); 
    9290        //CreatureGroup spawnCreatureGroup(int count, const string stfname, const string name, int objCrc, float x, float y, int bitmask = 0x00, int layout = 1); 
    9391 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/creature/CreatureManagerImplementation.cpp

    r884 r910  
    6060#include "../../objects/creature/shuttle/ShuttleCreature.h" 
    6161#include "../../objects/creature/action/ActionCreature.h" 
    62 #include "../../objects/creature/action/Action.h" 
    6362 
    6463#include "../../objects/creature/CreatureGroup.h" 
     
    143142        loadStaticCreatures(); 
    144143        loadBlueFrogs(); 
    145         //loadMissionCreatures(); 
    146144} 
    147145 
     
    273271                        TrainerCreature* trainer = spawnTrainer(prof->getName(), "", prof->getName(), 0x8C73B91, 0, -4967 - (i*1), 4043, 6, 0, 0); 
    274272                } 
    275         } 
    276 } 
    277  
    278 void CreatureManagerImplementation::loadMissionCreatures() { 
    279         //temporary to work with hardcode missions 
    280         if (zone->getZoneID() == 5) { 
    281                 string name = "MAN O' ACTION"; 
    282                 string stf = ""; 
    283                 ActionCreature* tac; 
    284                 tac = spawnActionCreature(name, stf, 0x8C73B91, "testM27", -4844.0f, 4155.0f, -.0339502, .999424); 
    285  
    286                 int actmsk = 0; 
    287                 actmsk |= ActionImplementation::TYPE_CONVERSE; 
    288                 Action* act = new Action((SceneObject*)tac, actmsk, 0); 
    289                 string scrnId = "0"; 
    290                 string leftBox = "Do you have...it?"; 
    291                 string Options = "Yes, here.|The weather is quite nice!|No, sorry I forgot."; //separate by | 
    292                 string optLink = "1,none|2,none|ENDCNV,none"; //separate by | (nextScreenID,actionKey) 
    293                 act->addConvoScreen(scrnId, leftBox, 3, Options, optLink); 
    294  
    295                 //Converstaion window in response to Yes, Here: 
    296                 scrnId = "1"; 
    297                 leftBox = "Cool you have it? Give it to me!"; 
    298                 Options = "Here|No, bye."; 
    299                 optLink = "EXECACTION,finm27|ENDCNV,none"; 
    300                 act->addConvoScreen(scrnId, leftBox, 1, Options, optLink); 
    301  
    302                 //Conversation window in response to weather: 
    303                 scrnId = "2"; 
    304                 leftBox = "Yea the weather is pretty nice.."; 
    305                 Options = "Bye."; 
    306                 optLink = "ENDCNV,none"; 
    307                 act->addConvoScreen(scrnId, leftBox, 1, Options, optLink); 
    308  
    309                 string actionKey = "KEYA"; 
    310                 tac->addAction(actionKey, act); 
    311                 tac->onConverse(actionKey); //link onConverse to action "KEYA" 
    312  
    313                 //Complete Mission Key: 
    314                 actmsk = 0; 
    315                 actmsk |= ActionImplementation::TYPE_TAKEITEM; 
    316                 actmsk |= ActionImplementation::TYPE_COMPMISSION; 
    317                 Action* act2 = new Action((SceneObject*)tac, actmsk, 0); 
    318  
    319                 actionKey = "finm27"; 
    320                 tac->addAction(actionKey, act2); 
    321273        } 
    322274} 
     
    368320                lock(doLock); 
    369321 
    370                 ActionCreature* actCr = new ActionCreature(getNextCreatureID(), objCrc, name, stfname, misoKey, server->getMissionManager()); 
     322                ActionCreature* actCr = new ActionCreature(getNextCreatureID(), objCrc, name, stfname, misoKey); 
    371323 
    372324                actCr->setTerrainName(Terrain::getTerrainName(zone->getZoneID())); 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/creature/CreatureManagerImplementation.h

    r764 r910  
    6161#include "../../objects/creature/action/ActionCreature.h" 
    6262#include "../../objects/creature/action/ActionCreatureImplementation.h" 
    63 #include "../../objects/creature/action/Action.h" 
    64 #include "../../objects/creature/action/ActionImplementation.h" 
    6563 
    6664#include "CreatureMap.h" 
     
    110108        void loadStaticCreatures(); 
    111109        void loadBlueFrogs(); 
    112         void loadMissionCreatures(); 
    113110 
    114111        void load(Creature* creature); 
     
    125122        RecruiterCreature* spawnRecruiter(float x, float y, float oY, float oW, uint8 type = 1, uint64 cellid = 0, bool doLock = true); 
    126123        BlueFrogCreature* spawnBlueFrog(float x, float y, float oY, float oW, int type = 0, uint64 cellid = 0, bool doLock = true); 
    127         ActionCreature* spawnActionCreature(string& name, string& stfname, uint32 objCrc, string misoKey, float x, float y, float oY, float oW, uint64 cellid = 0, bool doLock = true); 
     124        ActionCreature* spawnActionCreature(string& name, string& stfname, uint32 objCrc, const string misoKey, float x, float y, float oY, float oW, uint64 cellid = 0, bool doLock = true); 
    128125        //CreatureGroup* spawnCreatureGroup(int count, const string& stfname, const string& name, int objCrc, float x, float y, int bitmask = 0x00, int layout = LINE_LAYOUT); 
    129126        LairObject* spawnLair(const string& type, float x, float y, float z, bool doLock = true); 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/mission/MissionManager.cpp

    r842 r910  
    1212 
    1313#include "../../objects/tangible/TangibleObject.h" 
     14 
     15#include "../../objects/creature/action/ActionCreature.h" 
     16 
     17#include "../../objects/creature/action/Action.h" 
    1418 
    1519#include "server/zone/ZoneServer.h" 
     
    156160} 
    157161 
    158 void MissionManager::doMissionComplete(Player* player, string& tKey) { 
     162void MissionManager::doMissionComplete(Player* player, string& tKey, bool doLock) { 
    159163        if (_impl == NULL) { 
    160164                if (!deployed) 
     
    164168                method.addObjectParameter(player); 
    165169                method.addAsciiParameter(tKey); 
    166  
    167                 method.executeWithVoidReturn(); 
    168         } else 
    169                 ((MissionManagerImplementation*) _impl)->doMissionComplete(player, tKey); 
     170                method.addBooleanParameter(doLock); 
     171 
     172                method.executeWithVoidReturn(); 
     173        } else 
     174                ((MissionManagerImplementation*) _impl)->doMissionComplete(player, tKey, doLock); 
    170175} 
    171176 
     
    300305                break; 
    301306        case 14: 
    302                 doMissionComplete((Player*) inv->getObjectParameter(), inv->getAsciiParameter(_param1_doMissionComplete__Player_string_)); 
     307                doMissionComplete((Player*) inv->getObjectParameter(), inv->getAsciiParameter(_param1_doMissionComplete__Player_string_bool_), inv->getBooleanParameter()); 
    303308                break; 
    304309        case 15: 
     
    362367} 
    363368 
    364 void MissionManagerAdapter::doMissionComplete(Player* player, string& tKey) { 
    365         return ((MissionManagerImplementation*) impl)->doMissionComplete(player, tKey); 
     369void MissionManagerAdapter::doMissionComplete(Player* player, string& tKey, bool doLock) { 
     370        return ((MissionManagerImplementation*) impl)->doMissionComplete(player, tKey, doLock); 
    366371} 
    367372 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/mission/MissionManager.h

    r842 r910  
    1313 
    1414class TangibleObject; 
     15 
     16class ActionCreature; 
     17 
     18class Action; 
    1519 
    1620class ZoneServer; 
     
    3842        void doMissionAccept(Player* player, unsigned long long oid, bool doLock = true); 
    3943 
    40         void doMissionComplete(Player* player, string& tKey); 
     44        void doMissionComplete(Player* player, string& tKey, bool doLock = true); 
    4145 
    4246        void doMissionAbort(Player* player, unsigned long long oid, bool doLock = true); 
     
    8690        void doMissionAccept(Player* player, unsigned long long oid, bool doLock); 
    8791 
    88         void doMissionComplete(Player* player, string& tKey); 
     92        void doMissionComplete(Player* player, string& tKey, bool doLock); 
    8993 
    9094        void doMissionAbort(Player* player, unsigned long long oid, bool doLock); 
     
    109113        string _param16_poolMission__string_int_string_int_int_int_float_float_int_string_int_float_float_int_int_string_string_int_TangibleObject_bool_; 
    110114        string _param1_sendMission__Player_string_bool_; 
    111         string _param1_doMissionComplete__Player_string_
     115        string _param1_doMissionComplete__Player_string_bool_
    112116        string _param1_doMissionAbort__Player_string_bool_; 
    113117        string _param0_getMissionItemCrc__string_bool_; 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/mission/MissionManager.idl

    r842 r910  
    4646import "../../objects/mission/MissionObject"; 
    4747import "../../objects/tangible/TangibleObject"; 
     48import "../../objects/creature/action/ActionCreature"; 
     49import "../../objects/creature/action/Action"; 
    4850 
    4951import "server/zone/ZoneServer"; 
     
    7375        //events 
    7476        void doMissionAccept(Player player, unsigned long oid, boolean doLock = true); 
    75         void doMissionComplete(Player player, string tKey); 
     77        void doMissionComplete(Player player, string tKey, boolean doLock = true); 
    7678        void doMissionAbort(Player player, unsigned long oid, boolean doLock = true); 
    7779        void doMissionAbort(Player player, string tKey, boolean doLock = true); 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/mission/MissionManagerImplementation.cpp

    r842 r910  
    4848 
    4949#include "../../objects/player/Player.h" 
     50#include "../../objects/creature/action/ActionCreature.h" 
     51#include "../../objects/creature/action/Action.h" 
    5052 
    5153#include "../../packets.h" 
     
    158160 
    159161void MissionManagerImplementation::setupHardcodeMissions() { 
    160         /* 
    161         string dbKey = "testM27"; 
     162        string dbKey = ""; 
     163        dbKey = "testM27"; 
    162164        int tmask = TMASK_GENERAL; //terminal mask (GENERAL) 
    163165        string typeStr = "mission_deliver";  
     
    170172         
    171173        uint32 diffLv = 1;  
    172         float destX = 1337.0f;  
    173         float destY = 1337.0f;  
     174        float destX = -5049.0f; 
     175        float destY = 4225.0f;  
    174176        uint32 destPlanetCrc = Planet::getPlanetCRC("naboo"); 
    175177        string creatorName = "Ramsey"; 
    176178        uint32 rewardAmount = 50; 
    177         float targetX = 1234.0f;  
    178         float targetY = 1234.0f;  
     179        float targetX = -4844.0f;  
     180        float targetY = 4155.0f;  
    179181        uint32 targetPlanetCrc = Planet::getPlanetCRC("naboo"); 
    180         uint32 depictedObjCrc = 0x2D589F5B; //0x5B, 0x9F, 0x58, 0x2D, butterfly 
     182        uint32 depictedObjCrc = 0x9BA06548; //holocron/secret box crc 
    181183         
    182184        //string descriptionStf = "mission/mission_deliver_neutral_easy";  
    183185        //string titleStf = "mission/mission_deliver_neutral_easy";  
    184186        //For custom missions: 
    185         string descriptionStf = "Deliver this secret box to MAN O' Action."; 
     187        string descriptionStf = "Deliver this secret box to MAN O' Action. The last time I checked he was at -5049, 4225."; 
    186188        string titleStf = "The Box"; 
    187189         
     
    195197                        descriptionStf, titleStf, typeCrc, dvli, true); 
    196198         
    197         //test 2nd mission: 
    198         dbKey = "testM28"; 
    199         titleStf = "The Box 2"; 
    200          
    201         poolMission(dbKey, tmask, typeStr, descKey, titleKey, diffLv, destX, destY, destPlanetCrc, 
    202                         creatorName, rewardAmount, targetX, targetY, targetPlanetCrc, depictedObjCrc,  
    203                         descriptionStf, titleStf, typeCrc, NULL, true); 
    204         */ 
     199        //Setup NPC: 
     200        CreatureManager* cm = zoneServer->getCreatureManager(5); 
     201         
     202        string name = "MAN O' ACTION"; 
     203        string stf = ""; 
     204        ActionCreature* tac; 
     205        tac = cm->spawnActionCreature(name, stf, 0x8C73B91, "testM27", -5049.0f, 4225.0f, -0.0339502f, 0.999424f); 
     206        tac->setMisoMgr(this); 
     207         
     208        int actmsk = 0; 
     209        actmsk |= ActionImplementation::TYPE_CONVERSE; 
     210        Action* act = new Action((SceneObject*)tac, actmsk, 0); 
     211        string scrnId = "0"; 
     212        string leftBox = "Do you have...it?"; 
     213        string Options = "Yes, here.|The weather is quite nice!|No, sorry I forgot."; //separate by | 
     214        string optLink = "1,none|2,none|ENDCNV,none"; //separate by | (nextScreenID,actionKey) 
     215        act->addConvoScreen(scrnId, leftBox, 3, Options, optLink); 
     216 
     217        //Converstaion window in response to Yes, Here: 
     218        scrnId = "1"; 
     219        leftBox = "Cool you have it? Give it to me!"; 
     220        Options = "Here|No, bye."; 
     221        optLink = "EXECACTION,finm27|ENDCNV,none"; 
     222        act->addConvoScreen(scrnId, leftBox, 1, Options, optLink); 
     223 
     224        //Conversation window in response to weather: 
     225        scrnId = "2"; 
     226        leftBox = "Yea the weather is pretty nice.."; 
     227        Options = "Bye."; 
     228        optLink = "ENDCNV,none"; 
     229        act->addConvoScreen(scrnId, leftBox, 1, Options, optLink); 
     230 
     231        string actionKey = "KEYA"; 
     232        tac->addAction(actionKey, act); 
     233        tac->onConverse(actionKey); //link onConverse to action "KEYA" 
     234 
     235        //Complete Mission Key: 
     236        actmsk = 0; 
     237        actmsk |= ActionImplementation::TYPE_TAKEITEM; 
     238        actmsk |= ActionImplementation::TYPE_COMPMISSION; 
     239        Action* act2 = new Action((SceneObject*)tac, actmsk, 0); 
     240 
     241        actionKey = "finm27"; 
     242        tac->addAction(actionKey, act2); 
    205243} 
    206244 
     
    339377                //Check if player is already on mission: 
    340378                if(player->isOnCurMisoKey(miso->getDBKey())) { 
    341                         error("Player is already on mission!"); 
     379                        //error("Player is already on mission!"); 
    342380                        return; 
    343381                } 
     
    371409} 
    372410 
    373 void MissionManagerImplementation::doMissionComplete(Player* player, string& tKey) { 
    374         //system msg: "Mission Complete. You have been awarded: <rewards>" 
    375         player->sendSystemMessage("Mission Complete."); 
    376          
    377         PlayMusicMessage* pmm = new PlayMusicMessage("sound/music_mission_complete.snd"); 
    378         player->sendMessage(pmm); 
    379          
    380         removeMisoFromPlayer(player, tKey, true); 
    381          
    382         player->addToFinMisoKeys(tKey); 
    383         player->removeFromCurMisoKeys(tKey); 
     411void MissionManagerImplementation::doMissionComplete(Player* player, string& tKey, bool doLock) { 
     412        try { 
     413                lock(doLock); 
     414                 
     415                removeMisoFromPlayer(player, tKey, false); 
     416                 
     417                //system msg: "Mission Complete. You have been awarded: <rewards>" 
     418                player->sendSystemMessage("Mission Complete."); 
     419                //PlayMusicMessage* pmm = new PlayMusicMessage("sound/music_mission_complete.snd"); 
     420                //player->sendMessage(pmm); 
     421                player->addToFinMisoKeys(tKey); 
     422                player->removeFromCurMisoKeys(tKey); 
     423                 
     424                unlock(doLock); 
     425        } catch (...) { 
     426                error("unreported Exception caught on doMissionComplete()\n");  
     427 
     428                unlock(doLock); 
     429        } 
    384430} 
    385431 
     
    533579 
    534580void MissionManagerImplementation::removeMisoFromPlayer(Player* player, string& tKey, bool doLock) { 
    535         MissionObject* miso = NULL
    536          
    537         try { 
    538                 lock(doLock); 
    539          
     581        MissionObject* miso
     582         
     583        try { 
     584                lock(doLock); 
     585                
    540586                miso = misoMap->get(tKey); 
    541587                 
     
    569615 
    570616void MissionManagerImplementation::removeMisoFromPlayer(Player* player, uint64& oid, bool doLock) { 
    571         MissionObject* miso = NULL
     617        MissionObject* miso
    572618         
    573619        try { 
     
    605651 
    606652void MissionManagerImplementation::removeMisoFromPlayer(MissionObject* miso, Player* player) { 
     653        miso->sendDestroyTo(player); 
     654         
    607655        if(miso->getTypeStr() == "mission_deliver" && (miso->getDeliverItem() != NULL)) { 
    608656                TangibleObject* tmpi = (TangibleObject*)player->getMissionItem(miso->getDBKey()); 
     
    610658                        return; 
    611659                } 
    612  
    613660                player->removeInventoryItem(tmpi->getObjectID()); 
    614661                tmpi->sendDestroyTo(player); 
    615662                tmpi->finalize(); 
    616663        } 
    617          
    618         miso->sendDestroyTo(player); 
    619664} 
    620665 
  • core3/trunk/MMOCoreORB/src/server/zone/managers/mission/MissionManagerImplementation.h

    r842 r910  
    6161#include "../../objects/tangible/TangibleObjectImplementation.h" 
    6262 
     63#include "../../objects/creature/action/ActionCreature.h" 
     64#include "../../objects/creature/action/ActionCreatureImplementation.h" 
     65#include "../../objects/creature/action/Action.h" 
     66#include "../../objects/creature/action/ActionImplementation.h" 
     67 
    6368#include "MissionMap.h" 
    6469 
     
    97102        //events 
    98103        void doMissionAccept(Player* player, uint64& oid, bool doLock = true); 
    99         void doMissionComplete(Player* player, string& tKey); 
     104        void doMissionComplete(Player* player, string& tKey, bool doLock = true); 
    100105        void doMissionAbort(Player* player, uint64& oid, bool doLock = true); 
    101106        void doMissionAbort(Player* player, string& tKey, bool doLock = true); 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/Action.cpp

    r688 r910  
    99#include "ActionCreature.h" 
    1010 
    11 #include "../../../managers/mission/MissionManager.h" 
     11#include "../../../managers/mission/MissionManagerImplementation.h" 
    1212 
    1313#include "../../scene/SceneObject.h" 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/Action.h

    r688 r910  
    1010class ActionCreature; 
    1111 
    12 class MissionManager
     12class MissionManagerImplementation
    1313 
    1414class SceneObject; 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/Action.idl

    r686 r910  
    4545import "ActionCreature"; 
    4646 
    47 import "../../../managers/mission/MissionManager"; 
     47import "../../../managers/mission/MissionManagerImplementation"; 
    4848 
    4949import "../../scene/SceneObject"; 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/ActionCreature.cpp

    r688 r910  
    99#include "Action.h" 
    1010 
    11 #include "../../../managers/mission/MissionManager.h" 
     11#include "../../../managers/mission/MissionManagerImplementation.h" 
    1212 
    1313#include "../../scene/SceneObject.h" 
     
    2121 */ 
    2222 
    23 ActionCreature::ActionCreature(unsigned long long oid, unsigned int objCrc, string& creName, string& stf, string& missionKey, MissionManager* mMgr) : Creature(DummyConstructorParameter::instance()) { 
    24         _impl = new ActionCreatureImplementation(oid, objCrc, creName, stf, missionKey, mMgr); 
     23ActionCreature::ActionCreature(unsigned long long oid, unsigned int objCrc, string& creName, string& stf, string& missionKey) : Creature(DummyConstructorParameter::instance()) { 
     24        _impl = new ActionCreatureImplementation(oid, objCrc, creName, stf, missionKey); 
    2525        _impl->_setStub(this); 
    2626} 
     
    137137} 
    138138 
    139 MissionManager* ActionCreature::getMisoMgr() { 
     139MissionManagerImplementation* ActionCreature::getMisoMgr() { 
     140        if (_impl == NULL) { 
     141                throw ObjectNotLocalException(this); 
     142 
     143        } else 
     144                return ((ActionCreatureImplementation*) _impl)->getMisoMgr(); 
     145
     146 
     147void ActionCreature::setMisoMgr(MissionManagerImplementation* tmgr) { 
     148        if (_impl == NULL) { 
     149                throw ObjectNotLocalException(this); 
     150 
     151        } else 
     152                ((ActionCreatureImplementation*) _impl)->setMisoMgr(tmgr); 
     153
     154 
     155void ActionCreature::sendConversationStartTo(SceneObject* obj) { 
    140156        if (_impl == NULL) { 
    141157                if (!deployed) 
     
    143159 
    144160                DistributedMethod method(this, 14); 
    145  
    146                 return (MissionManager*) method.executeWithObjectReturn(); 
    147         } else 
    148                 return ((ActionCreatureImplementation*) _impl)->getMisoMgr(); 
    149 
    150  
    151 void ActionCreature::sendConversationStartTo(SceneObject* obj) { 
     161                method.addObjectParameter(obj); 
     162 
     163                method.executeWithVoidReturn(); 
     164        } else 
     165                ((ActionCreatureImplementation*) _impl)->sendConversationStartTo(obj); 
     166
     167 
     168void ActionCreature::selectConversationOption(int option, SceneObject* obj) { 
    152169        if (_impl == NULL) { 
    153170                if (!deployed) 
     
    155172 
    156173                DistributedMethod method(this, 15); 
    157                 method.addObjectParameter(obj); 
    158  
    159                 method.executeWithVoidReturn(); 
    160         } else 
    161                 ((ActionCreatureImplementation*) _impl)->sendConversationStartTo(obj); 
    162 } 
    163  
    164 void ActionCreature::selectConversationOption(int option, SceneObject* obj) { 
    165         if (_impl == NULL) { 
    166                 if (!deployed) 
    167                         throw ObjectNotDeployedException(this); 
    168  
    169                 DistributedMethod method(this, 16); 
    170174                method.addSignedIntParameter(option); 
    171175                method.addObjectParameter(obj); 
     
    212216                break; 
    213217        case 14: 
    214                 resp->insertLong(getMisoMgr()->_getObjectID()); 
     218                sendConversationStartTo((SceneObject*) inv->getObjectParameter()); 
    215219                break; 
    216220        case 15: 
    217                 sendConversationStartTo((SceneObject*) inv->getObjectParameter()); 
    218                 break; 
    219         case 16: 
    220221                selectConversationOption(inv->getSignedIntParameter(), (SceneObject*) inv->getObjectParameter()); 
    221222                break; 
     
    259260} 
    260261 
    261 MissionManager* ActionCreatureAdapter::getMisoMgr() { 
    262         return ((ActionCreatureImplementation*) impl)->getMisoMgr(); 
    263 } 
    264  
    265262void ActionCreatureAdapter::sendConversationStartTo(SceneObject* obj) { 
    266263        return ((ActionCreatureImplementation*) impl)->sendConversationStartTo(obj); 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/ActionCreature.h

    r688 r910  
    1010class Action; 
    1111 
    12 class MissionManager
     12class MissionManagerImplementation
    1313 
    1414class SceneObject; 
     
    2222class ActionCreature : public Creature { 
    2323public: 
    24         ActionCreature(unsigned long long oid, unsigned int objCrc, string& creName, string& stf, string& missionKey, MissionManager* mMgr = NULL); 
     24        ActionCreature(unsigned long long oid, unsigned int objCrc, string& creName, string& stf, string& missionKey); 
    2525 
    2626        void addAction(string& key, Action* act); 
     
    4040        string& getMissionKey(); 
    4141 
    42         MissionManager* getMisoMgr(); 
     42        MissionManagerImplementation* getMisoMgr(); 
     43 
     44        void setMisoMgr(MissionManagerImplementation* tmgr); 
    4345 
    4446        void sendConversationStartTo(SceneObject* obj); 
     
    7981 
    8082        string& getMissionKey(); 
    81  
    82         MissionManager* getMisoMgr(); 
    8383 
    8484        void sendConversationStartTo(SceneObject* obj); 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/ActionCreature.idl

    r686 r910  
    4545import "Action"; 
    4646 
    47 import "../../../managers/mission/MissionManager"; 
     47import "../../../managers/mission/MissionManagerImplementation"; 
    4848 
    4949import "../../scene/SceneObject"; 
     
    5555interface ActionCreature implements Creature { 
    5656 
    57         ActionCreature(unsigned long oid, unsigned int objCrc, string creName, string stf, string missionKey, MissionManager mMgr = NULL) { 
     57        ActionCreature(unsigned long oid, unsigned int objCrc, string creName, string stf, string missionKey) { 
    5858                super(oid); 
    5959        } 
     
    7272        boolean isMissionNpc(); //Returns true if NPC has a mission assigned to it. 
    7373        string getMissionKey(); 
    74         MissionManager getMisoMgr(); 
     74        local MissionManagerImplementation getMisoMgr(); 
     75        local void setMisoMgr(MissionManagerImplementation tmgr); 
    7576         
    7677        //Conversation Specific: 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/ActionCreatureImplementation.cpp

    r687 r910  
    4949#include "../../player/Player.h" 
    5050 
    51 #include "../../../managers/mission/MissionManager.h" 
     51#include "../../../managers/mission/MissionManagerImplementation.h" 
    5252 
    5353#include "../../../packets.h" 
     
    5656 
    5757ActionCreatureImplementation::ActionCreatureImplementation(uint64 oid, uint32 objCrc, string& creName, string& stf,  
    58                 string& missionKey, MissionManager* mMgr) : ActionCreatureServant(oid) { 
     58                string& missionKey) : ActionCreatureServant(oid) { 
    5959         
    6060        // General NPC: 
     
    7575        // Mission: 
    7676        misoKey = missionKey; 
    77         misoMgr = mMgr; 
    7877         
    7978        stringstream loggingname; 
     
    184183} 
    185184 
    186 MissionManager* ActionCreatureImplementation::getMisoMgr() { 
    187         if(misoMgr == NULL) { 
    188                 misoMgr = server->getMissionManager(); 
    189         } 
    190         return misoMgr; 
    191 } 
    192185 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/ActionCreatureImplementation.h

    r687 r910  
    4646#define ACTIONCREATUREIMPLEMENTATION_H_ 
    4747 
     48class MissionManagerImplementation; 
     49 
    4850class Player; 
    4951class SceneObject; 
     52 
     53#include "engine/engine.h" 
    5054 
    5155#include "ActionCreature.h" 
     
    5761         
    5862        string misoKey; //Mission Key 
    59         MissionManager* misoMgr; 
     63        MissionManagerImplementation* misoMgr; 
    6064         
    6165        //Trigger Action Keys: 
     
    6670         
    6771public: 
    68         ActionCreatureImplementation(uint64 oid, uint32 objCrc, string& creName, string& stf,  
    69                         string& missionKey, MissionManager* mMgr = NULL); 
     72        ActionCreatureImplementation(uint64 oid, uint32 objCrc, string& creName, string& stf, string& missionKey); 
    7073        ~ActionCreatureImplementation(); 
    7174         
     
    9295        } 
    9396         
    94         MissionManager* getMisoMgr(); 
     97        //Mission Manager: 
     98        inline MissionManagerImplementation* getMisoMgr() { 
     99                return misoMgr; 
     100        } 
     101         
     102        inline void setMisoMgr(MissionManagerImplementation* tmgr) { 
     103                misoMgr = tmgr; 
     104        } 
    95105         
    96106        //Conversation Specific: 
     
    108118                actionList.removeAll(); 
    109119        } 
     120         
     121        friend class MissionManagerImplementation; 
    110122 
    111123}; 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/creature/action/ActionImplementation.cpp

    r842 r910  
    4646#include "ActionImplementation.h" 
    4747 
    48 #include "../../../managers/mission/MissionManager.h" 
     48#include "../../../managers/mission/MissionManagerImplementation.h" 
    4949 
    5050#include "../../../packets.h" 
     
    6666        if(!prereqCheck(player)) 
    6767                return; 
    68  
     68         
    6969        if((actionMask & TYPE_MOVE)) { 
    7070        } 
     
    9797                         
    9898                        pItem = player->getMissionItem(misoKey); 
     99                         
    99100                        if(pItem == NULL) { 
    100101                                //Elaborate with NPC dialogue later. 
    101                                 StopNpcConversation* scv = new StopNpcConversation(player, parentCreature->getObjectID()); 
    102                                 player->sendMessage(scv); 
    103                                 player->setLastNpcConvStr(""); 
    104                                 player->setLastNpcConvMessStr(""); 
     102                                //printf("Cannot get mission item from player, it is NULL\n"); 
    105103                                return; 
    106104                        } 
     
    115113        if((actionMask & TYPE_COMPMISSION)) { 
    116114                string misoKey; 
    117                 MissionManager* mMgr; 
    118                  
    119                 printf("comp mission 1\n"); 
     115                MissionManagerImplementation* mMgr; 
    120116                 
    121117                if(parentObject->isNonPlayerCreature()) { 
     
    127123                                return; 
    128124                         
    129                         printf("comp mission 2\n"); 
    130                          
    131125                        misoKey = parentCreature->getMissionKey(); 
    132126                        mMgr = parentCreature->getMisoMgr(); 
    133127                         
    134128                        if(mMgr == NULL) { 
    135                                 //printf("Cannot complete mission, mission manager is null in parent creature\n"); 
     129                                printf("Cannot complete mission, mission manager is null in parent creature\n"); 
    136130                                return; 
    137131                        } 
    138132                         
    139                         printf("comp mission 3\n"); 
    140                          
    141                         mMgr->doMissionComplete(player, misoKey); 
    142                         printf("comp mission 4\n"); 
     133                        if(misoKey.size() == 0) { 
     134                                return; 
     135                        } 
     136                         
     137                        mMgr->doMissionComplete(player, misoKey, false); 
    143138                } /*else if(parentObject->isAttackableObject()) { 
    144139                        //For lairs 
     
    149144        if((actionMask & TYPE_FAILMISSION)) { 
    150145                string misoKey; 
    151                 MissionManager* mMgr; 
     146                MissionManagerImplementation* mMgr; 
    152147                 
    153148                if(parentObject->isNonPlayerCreature()) { 
     
    162157                        mMgr = parentCreature->getMisoMgr(); 
    163158                         
    164                         mMgr->doMissionAbort(player, misoKey); 
     159                        if(mMgr == NULL) { 
     160                                //printf("Cannot abort mission, mission manager is null in parent creature\n"); 
     161                                return; 
     162                        } 
     163                         
     164                        mMgr->doMissionAbort(player, misoKey, false); 
    165165                         
    166166                } /*else if(parentObject->isAttackableObject()) { 
     
    227227                        return; 
    228228                } 
    229                  
    230                 //printf("Got screen/Option pair: %s . Used convMessStr: %s \n", tns.c_str(), player->getLastNpcConvMessStr().c_str()); 
    231                  
     229                                 
    232230                string newScreenID; 
    233231                string actKey; 
     
    312310                } 
    313311        } 
    314         // 
    315312         
    316313        return false; 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/mission/MissionObjectImplementation.cpp

    r686 r910  
    125125 
    126126        MissionObjectDeltaMessage3* dmiso3 = new MissionObjectDeltaMessage3((MissionObject*) _this); 
    127  
    128         dmiso3->updateDescriptionStf(); //11 (0B) 
    129         dmiso3->updateDescKey(); //4 
     127        size_t posD; 
     128        size_t posT; 
     129         
     130        posD = descriptionStf.find("mission/"); 
     131        posT = titleStf.find("mission/"); 
     132         
     133        if(posD == string::npos) { 
     134                dmiso3->updateDescriptionStf(false); //11 (0B) 
     135        } else { 
     136                dmiso3->updateDescriptionStf(true); //11 (0B) 
     137                dmiso3->updateDescKey(); //4 
     138        } 
    130139        dmiso3->updateDifficultyLv(); //5 
    131140        dmiso3->updateDestination(); //6 
     
    135144        dmiso3->updateTarget(); //9 
    136145        dmiso3->updateDepictedObject(); //10 (0A) 
    137         dmiso3->updateTitleStf(); //12 (0C) 
    138         dmiso3->updateTitleKey(); //4 
     146        if(posD == string::npos) { 
     147                dmiso3->updateTitleStf(false); //12 (0C) 
     148        } else { 
     149                dmiso3->updateTitleStf(true); //12 (0C) 
     150                dmiso3->updateTitleKey(); //4 
     151        } 
    139152        dmiso3->updateRefreshCount(player->nextMisoRFC()); //13 (0D) 
    140153 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/player/PlayerImplementation.cpp

    r907 r910  
    36283628// Mission Functions 
    36293629 
    3630 bool PlayerImplementation::isOnCurMisoKey(string& tmk) { 
     3630bool PlayerImplementation::isOnCurMisoKey(string tmk) { 
    36313631        tmk += ","; 
    36323632 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/player/PlayerImplementation.h

    r901 r910  
    775775                curMisoKeys += (tck + ","); 
    776776        } 
    777         bool isOnCurMisoKey(string& tmk); //player is currently on the mission key 
     777        bool isOnCurMisoKey(string tmk); //player is currently on the mission key 
    778778        void removeFromCurMisoKeys(string tck); 
    779779 
  • core3/trunk/MMOCoreORB/src/server/zone/objects/tangible/InventoryImplementation.h

    r842 r910  
    8181                                tano = (TangibleObject*)obj; 
    8282                                 
    83                                 if((tano->getMisoAsocKey() == misKey) && (!tano->isEquipped())) { 
     83                                if((!strcmp(tano->getMisoAsocKey().c_str(), misKey.c_str())) && (!tano->isEquipped())) { 
    8484                                        break; 
     85                                } else { 
     86                                        tano = NULL; 
    8587                                } 
    86                                  
    87                                 tano = NULL; 
    8888                        } 
    8989                } 
  • core3/trunk/MMOCoreORB/src/server/zone/packets/mission/MissionObjectDeltaMessage3.h

    r493 r910  
    118118        } 
    119119         
    120         void updateDescriptionStf() { 
     120        void updateDescriptionStf(bool isStf) { 
    121121                startUpdate(0x0B); 
    122                  
    123                 insertAscii(miso->getDescriptionStf()); 
     122 
     123                if (!isStf) { 
     124                        insertShort(0); //No stf string 
     125                        insertInt(0); 
     126                        insertAscii(miso->getDescriptionStf()); 
     127                } else { 
     128                        insertAscii(miso->getDescriptionStf()); 
     129                        insertInt(0); 
     130                } 
    124131        } 
    125132         
    126         void updateTitleStf() { 
     133        void updateTitleStf(bool isStf) { 
    127134                startUpdate(0x0C); 
    128                  
    129                 insertAscii(miso->getTitleStf()); 
     135 
     136                if (!isStf) { 
     137                        insertShort(0); //No stf string 
     138                        insertInt(0); 
     139                        insertAscii(miso->getTitleStf()); 
     140                } else { 
     141                        insertAscii(miso->getTitleStf()); 
     142                        insertInt(0); 
     143                } 
    130144        } 
    131145         
  • core3/trunk/MMOCoreORB/src/server/zone/packets/mission/MissionObjectMessage3.h

    r686 r910  
    6666                 
    6767                insertFloat(1.0f); 
    68  
     68                 
    6969                if(mi->getTitleKey() != 0) { 
    7070                        insertAscii("mission/mission_object"); 
    71                 } else { 
    72                         insertAscii(mi->getTitleStf()); 
    73                 } 
    74                 insertInt(0); 
    75                  
    76                 if(mi->getTitleKey() != 0) { 
     71                        insertInt(0); 
    7772                        insertAscii(mi->getTypeStr()); 
    7873                } else { 
    7974                        insertAscii(""); 
     75                        insertInt(0); 
     76                        insertAscii(mi->getTitleStf()); 
    8077                } 
    8178