diff options
Diffstat (limited to 'reference/game.c')
| -rw-r--r-- | reference/game.c | 6323 |
1 files changed, 0 insertions, 6323 deletions
diff --git a/reference/game.c b/reference/game.c index 06d70d8..c44699e 100644 --- a/reference/game.c +++ b/reference/game.c @@ -18537,6285 +18537,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority return;
}
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-TNode * NewNode(void)
-
-{
- TNode *Node;
- TNode *pTVar1;
- int in_stack_00000004;
- TNode *in_stack_00000008;
- TNode *in_stack_0000000c;
-
- pTVar1 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar1->Type = in_stack_00000004;
- pTVar1->Left = in_stack_00000008;
- pTVar1->Right = in_stack_0000000c;
- return pTVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-TNode * NewNode(void)
-
-{
- TNode *Node;
- TNode *pTVar1;
- int in_stack_00000004;
- int in_stack_00000008;
-
- pTVar1 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar1->Type = in_stack_00000004;
- pTVar1->Left = (TNode *)0x0;
- pTVar1->Right = (TNode *)0x0;
- pTVar1->Data = in_stack_00000008;
- return pTVar1;
-}
-
-
-
-void DeleteNode(TNode *Node)
-
-{
- store<TNode,256> *psVar1;
-
- if (Node != (TNode *)0x0) {
- DeleteNode(Node->Left);
- DeleteNode(Node->Right);
- psVar1 = NodeTable;
- Node->Type = (int)NodeTable->firstFreeItem;
- psVar1->firstFreeItem = (storeitem<TNode> *)Node;
- }
- return;
-}
-
-
-
-// DWARF original prototype: bool set(TCondition * this, int Type, void * Data)
-
-bool __thiscall TCondition::set(TCondition *this,int Type,void *Data)
-
-{
- ulong uVar1;
- int iVar2;
- char *pcVar3;
- char *pcVar4;
- bool bVar5;
-
- if ((Type != 5) && (Data == (void *)0x0)) {
- error("TCondition::set: Data ist NULL.\n");
- this->Type = 0;
- return false;
- }
- this->Type = Type;
- bVar5 = Type == 5;
- switch(Type) {
- default:
- error(&DAT_08104a80,Type);
- return false;
- case 1:
- uVar1 = AddDynamicString((char *)Data);
- this->Text = uVar1;
- break;
- case 2:
- this->Property = 0;
- iVar2 = 8;
- pcVar3 = (char *)Data;
- pcVar4 = "address";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 1;
- }
- iVar2 = 5;
- pcVar3 = (char *)Data;
- pcVar4 = "busy";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 2;
- }
- iVar2 = 7;
- pcVar3 = (char *)Data;
- pcVar4 = "vanish";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 3;
- }
- iVar2 = 5;
- pcVar3 = (char *)Data;
- pcVar4 = "male";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 4;
- }
- iVar2 = 7;
- pcVar3 = (char *)Data;
- pcVar4 = "female";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 5;
- }
- iVar2 = 7;
- pcVar3 = (char *)Data;
- pcVar4 = "knight";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 6;
- }
- iVar2 = 8;
- pcVar3 = (char *)Data;
- pcVar4 = "paladin";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 7;
- }
- iVar2 = 9;
- pcVar3 = (char *)Data;
- pcVar4 = "sorcerer";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 8;
- }
- iVar2 = 6;
- pcVar3 = (char *)Data;
- pcVar4 = "druid";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 9;
- }
- iVar2 = 8;
- pcVar3 = (char *)Data;
- pcVar4 = "premium";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 10;
- }
- iVar2 = 9;
- pcVar3 = (char *)Data;
- pcVar4 = "promoted";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 0xb;
- }
- iVar2 = 8;
- pcVar3 = (char *)Data;
- pcVar4 = "pzblock";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 0xc;
- }
- iVar2 = 7;
- pcVar3 = (char *)Data;
- pcVar4 = "nonpvp";
- do {
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *pcVar3 == *pcVar4;
- pcVar3 = pcVar3 + 1;
- pcVar4 = pcVar4 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 0xd;
- }
- iVar2 = 0xc;
- pcVar3 = "pvpenforced";
- do {
- // WARNING: Load size is inaccurate
- if (iVar2 == 0) break;
- iVar2 = iVar2 + -1;
- bVar5 = *Data == *pcVar3;
- Data = (char *)((int)Data + 1);
- pcVar3 = pcVar3 + 1;
- } while (bVar5);
- if (bVar5) {
- this->Property = 0xe;
- }
- if (this->Property == 0) {
- return false;
- }
- return true;
- case 3:
- // WARNING: Load size is inaccurate
- this->Number = *Data;
- break;
- case 4:
- this->Expression = (TNode *)Data;
- break;
- case 5:
- break;
- }
- return true;
-}
-
-
-
-// DWARF original prototype: void clear(TCondition * this)
-
-void __thiscall TCondition::clear(TCondition *this)
-
-{
- storeitem<TNode> *psVar1;
- store<TNode,256> *psVar2;
- int iVar3;
-
- iVar3 = this->Type;
- if ((iVar3 == 4) &&
- (psVar1 = (storeitem<TNode> *)this->Expression, psVar1 != (storeitem<TNode> *)0x0)) {
- DeleteNode((psVar1->data).Left);
- DeleteNode((psVar1->data).Right);
- psVar2 = NodeTable;
- psVar1->next = NodeTable->firstFreeItem;
- psVar2->firstFreeItem = psVar1;
- iVar3 = this->Type;
- }
- if (iVar3 == 1) {
- DeleteDynamicString(this->Text);
- }
- this->Type = 0;
- return;
-}
-
-
-
-// DWARF original prototype: bool set(TAction * this, int Type, void * Data, void * Data2, void *
-// Data3, void * Data4)
-
-bool __thiscall TAction::set(TAction *this)
-
-{
- int iVar1;
- ulong uVar2;
- int in_stack_00000008;
- int *in_stack_0000000c;
- TNode *in_stack_00000010;
- TNode *in_stack_00000014;
- TNode *in_stack_00000018;
-
- this->Type = in_stack_00000008;
- switch(in_stack_00000008) {
- default:
- error(&DAT_08104b00);
- return false;
- case 1:
- uVar2 = AddDynamicString((char *)in_stack_0000000c);
- this->Text = uVar2;
- break;
- case 2:
- case 3:
- case 5:
- iVar1 = *in_stack_0000000c;
- this->Expression = in_stack_00000010;
- this->Number = iVar1;
- break;
- case 4:
- case 8:
- iVar1 = *in_stack_0000000c;
- this->Expression2 = in_stack_00000014;
- this->Expression = in_stack_00000010;
- this->Number = iVar1;
- break;
- case 6:
- case 7:
- this->Number = *in_stack_0000000c;
- break;
- case 9:
- break;
- case 10:
- iVar1 = *in_stack_0000000c;
- this->Expression2 = in_stack_00000014;
- this->Expression = in_stack_00000010;
- this->Number = iVar1;
- this->Expression3 = in_stack_00000018;
- }
- return true;
-}
-
-
-
-// DWARF original prototype: void clear(TAction * this)
-
-void __thiscall TAction::clear(TAction *this)
-
-{
- storeitem<TNode> *psVar1;
- store<TNode,256> *psVar2;
- int iVar3;
-
- iVar3 = this->Type;
- if ((((iVar3 - 2U < 4) || (iVar3 == 8)) || (iVar3 == 10)) &&
- (psVar1 = (storeitem<TNode> *)this->Expression, psVar1 != (storeitem<TNode> *)0x0)) {
- DeleteNode((psVar1->data).Left);
- DeleteNode((psVar1->data).Right);
- psVar2 = NodeTable;
- psVar1->next = NodeTable->firstFreeItem;
- psVar2->firstFreeItem = psVar1;
- iVar3 = this->Type;
- }
- if (((iVar3 == 4) || (iVar3 == 8)) || (iVar3 == 10)) {
- psVar1 = (storeitem<TNode> *)this->Expression2;
- if (psVar1 != (storeitem<TNode> *)0x0) {
- DeleteNode((psVar1->data).Left);
- DeleteNode((psVar1->data).Right);
- psVar2 = NodeTable;
- psVar1->next = NodeTable->firstFreeItem;
- psVar2->firstFreeItem = psVar1;
- iVar3 = this->Type;
- }
- if ((iVar3 == 10) &&
- (psVar1 = (storeitem<TNode> *)this->Expression3, psVar1 != (storeitem<TNode> *)0x0)) {
- DeleteNode((psVar1->data).Left);
- DeleteNode((psVar1->data).Right);
- psVar2 = NodeTable;
- psVar1->next = NodeTable->firstFreeItem;
- psVar2->firstFreeItem = psVar1;
- iVar3 = this->Type;
- }
- }
- if (iVar3 == 1) {
- DeleteDynamicString(this->Text);
- }
- this->Type = 0;
- return;
-}
-
-
-
-// DWARF original prototype: void TBehaviour(TBehaviour * this)
-
-void __thiscall TBehaviour::TBehaviour(TBehaviour *this)
-
-{
- vector<TCondition>::vector(&this->Condition,0,5,5);
- // try { // try from 080b051d to 080b0521 has its CatchHandler @ 080b0540
- vector<TAction>::vector(&this->Action,0,5,5);
- this->Conditions = 0;
- this->Actions = 0;
- return;
-}
-
-
-
-// DWARF original prototype: void TBehaviour(TBehaviour * this)
-
-void __thiscall TBehaviour::TBehaviour(TBehaviour *this)
-
-{
- vector<TCondition>::vector(&this->Condition,0,5,5);
- // try { // try from 080b05ad to 080b05b1 has its CatchHandler @ 080b05d0
- vector<TAction>::vector(&this->Action,0,5,5);
- this->Conditions = 0;
- this->Actions = 0;
- return;
-}
-
-
-
-// DWARF original prototype: void ~TBehaviour(TBehaviour * this, int __in_chrg)
-
-void __thiscall TBehaviour::~TBehaviour(TBehaviour *this,int __in_chrg)
-
-{
- TAction *pTVar1;
- TCondition *pTVar2;
- int i;
- int iVar3;
- int iVar4;
-
- iVar3 = 0;
- if (0 < this->Conditions) {
- do {
- iVar4 = iVar3 + 1;
- pTVar2 = vector<TCondition>::operator()(&this->Condition,iVar3);
- TCondition::clear(pTVar2);
- iVar3 = iVar4;
- } while (iVar4 < this->Conditions);
- }
- if (0 < this->Actions) {
- iVar3 = 0;
- do {
- iVar4 = iVar3 + 1;
- pTVar1 = vector<TAction>::operator()(&this->Action,iVar3);
- TAction::clear(pTVar1);
- iVar3 = iVar4;
- } while (iVar4 < this->Actions);
- }
- pTVar1 = (this->Action).entry;
- if (pTVar1 != (TAction *)0x0) {
- operator_delete__(pTVar1);
- }
- pTVar2 = (this->Condition).entry;
- if (pTVar2 != (TCondition *)0x0) {
- operator_delete__(pTVar2);
- return;
- }
- return;
-}
-
-
-
-// DWARF original prototype: void ~TBehaviour(TBehaviour * this, int __in_chrg)
-
-void __thiscall TBehaviour::~TBehaviour(TBehaviour *this,int __in_chrg)
-
-{
- TAction *pTVar1;
- TCondition *pTVar2;
- int i;
- int iVar3;
- int iVar4;
-
- iVar3 = 0;
- if (0 < this->Conditions) {
- do {
- iVar4 = iVar3 + 1;
- pTVar2 = vector<TCondition>::operator()(&this->Condition,iVar3);
- TCondition::clear(pTVar2);
- iVar3 = iVar4;
- } while (iVar4 < this->Conditions);
- }
- if (0 < this->Actions) {
- iVar3 = 0;
- do {
- iVar4 = iVar3 + 1;
- pTVar1 = vector<TAction>::operator()(&this->Action,iVar3);
- TAction::clear(pTVar1);
- iVar3 = iVar4;
- } while (iVar4 < this->Actions);
- }
- pTVar1 = (this->Action).entry;
- if (pTVar1 != (TAction *)0x0) {
- operator_delete__(pTVar1);
- }
- pTVar2 = (this->Condition).entry;
- if (pTVar2 != (TCondition *)0x0) {
- operator_delete__(pTVar2);
- return;
- }
- return;
-}
-
-
-
-// DWARF original prototype: bool addCondition(TBehaviour * this, int Type, void * Data)
-
-bool __thiscall TBehaviour::addCondition(TBehaviour *this)
-
-{
- bool bVar1;
- TCondition *this_00;
- int in_stack_00000008;
- void *in_stack_0000000c;
-
- this_00 = vector<TCondition>::operator()(&this->Condition,this->Conditions);
- bVar1 = TCondition::set(this_00,in_stack_00000008,in_stack_0000000c);
- if (bVar1) {
- this->Conditions = this->Conditions + 1;
- }
- return bVar1;
-}
-
-
-
-// DWARF original prototype: bool addAction(TBehaviour * this, int Type, void * Data, void * Data2,
-// void * Data3, void * Data4)
-
-bool __thiscall TBehaviour::addAction(TBehaviour *this)
-
-{
- bool bVar1;
- TAction *this_00;
-
- this_00 = vector<TAction>::operator()(&this->Action,this->Actions);
- bVar1 = TAction::set(this_00);
- if (bVar1) {
- this->Actions = this->Actions + 1;
- }
- return bVar1;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Nr
-// DWARF original prototype: void TBehaviourDatabase(TBehaviourDatabase * this, TReadScriptFile *
-// Script)
-
-void __thiscall
-TBehaviourDatabase::TBehaviourDatabase(TBehaviourDatabase *this,TReadScriptFile *Script)
-
-{
- char cVar1;
- bool bVar2;
- TNode *Node;
- TNode *pTVar3;
- TNode *pTVar4;
- TBehaviour *pTVar5;
- TCondition *pTVar6;
- TAction *pTVar7;
- undefined4 uVar8;
- TOKEN TVar9;
- int iVar10;
- bool Success;
- char *pcVar11;
- TNode *Right;
- char *pcVar12;
- undefined1 uVar13;
- char *pcVar14;
- TNode *local_4c;
- TNode *Left_6;
- TNode *local_44;
- TNode *Left_10;
- TNode *Left_8;
- TNode *Left_16;
- TNode *Left_14;
- TNode *Left_12;
- TNode *Left_4;
- undefined4 local_28;
- int Type;
- TNode *Left_2;
- int Operator;
- TNode *Left;
- int Data;
- int Nr;
-
- // try { // try from 080b07f7 to 080b07fb has its CatchHandler @ 080b1d30
- vector<TBehaviour>::vector(&this->Behaviour,0,0x32,0x19);
- this->Behaviours = 0;
- // try { // try from 080b0815 to 080b0824 has its CatchHandler @ 080b1d20
- TReadScriptFile::readSymbol(Script,'{');
- TReadScriptFile::nextToken(Script);
-LAB_080b0825:
- TVar9 = Script->Token;
- if (TVar9 != SPECIAL) goto LAB_080b0833;
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 == '}') {
- return;
- }
- TVar9 = Script->Token;
- if (TVar9 != SPECIAL) goto LAB_080b0833;
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != 'I') {
-LAB_080b0ae0:
- TVar9 = Script->Token;
-LAB_080b0833:
- bVar2 = false;
- if (TVar9 == STRING) {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pcVar14 = TReadScriptFile::getString(Script);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,1,pcVar14);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- TVar9 = Script->Token;
- }
- if (TVar9 == IDENTIFIER) {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pcVar14 = TReadScriptFile::getIdentifier(Script);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,2,pcVar14);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- TVar9 = Script->Token;
- }
- if (TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 == '!') {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,5,(void *)0x0);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- TVar9 = Script->Token;
- }
- else {
- TVar9 = Script->Token;
- }
- if ((TVar9 == SPECIAL) && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '%')) {
- Data = TReadScriptFile::readNumber(Script);
- if (2 < Data - 1U) {
- TReadScriptFile::error(Script,"illegal ordinal number");
- }
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,3,&Data);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- }
- }
- if (!bVar2) {
- // try { // try from 080b0865 to 080b08ad has its CatchHandler @ 080b1bd0
- Operator = (int)readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = (TNode *)Operator;
- pTVar4->Right = pTVar3;
- Operator = (int)pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) goto LAB_080b093c;
- // try { // try from 080b08cf to 080b0921 has its CatchHandler @ 080b1c4a
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if (Script->Token == SPECIAL) goto LAB_080b094f;
- goto LAB_080b093c;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = (TNode *)Operator;
- TVar9 = Script->Token;
- Operator = (int)pTVar4;
- } while( true );
- }
- TReadScriptFile::nextToken(Script);
- goto LAB_080b0ac1;
- }
- goto LAB_080b0b09;
-LAB_080b093c:
- // try { // try from 080b094a to 080b0986 has its CatchHandler @ 080b1d20
- TReadScriptFile::error(Script,"relational operator expected");
-LAB_080b094f:
- Left_2 = (TNode *)0x0;
- cVar1 = TReadScriptFile::getSpecial(Script);
- switch(cVar1) {
- case '<':
- Left_2 = (TNode *)0x1;
- break;
- case '=':
- Left_2 = (TNode *)0x3;
- break;
- case '>':
- Left_2 = (TNode *)0x2;
- break;
- default:
- TReadScriptFile::error(Script,"relational operator expected");
- break;
- case 'G':
- Left_2 = (TNode *)0x6;
- break;
- case 'L':
- Left_2 = (TNode *)0x5;
- break;
- case 'N':
- Left_2 = (TNode *)0x4;
- }
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b0994 to 080b09d9 has its CatchHandler @ 080b1c5b
- Type = (int)readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = (TNode *)Type;
- pTVar4->Right = pTVar3;
- Type = (int)pTVar4;
- }
- // try { // try from 080b09fb to 080b0a4d has its CatchHandler @ 080b1c70
- while ((TVar9 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = (TNode *)Type;
- TVar9 = Script->Token;
- Type = (int)pTVar4;
- }
- // try { // try from 080b0a68 to 080b0f5a has its CatchHandler @ 080b1d20
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (int)Left_2;
- pTVar3->Left = (TNode *)Operator;
- pTVar3->Right = (TNode *)Type;
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,4,pTVar3);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
-LAB_080b0ac1:
- if (Script->Token != SPECIAL) goto LAB_080b0af6;
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != ',') goto LAB_080b0aea;
- TReadScriptFile::nextToken(Script);
- goto LAB_080b0ae0;
-LAB_080b0aea:
- if ((Script->Token != SPECIAL) || (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != 'I')) {
-LAB_080b0af6:
- TReadScriptFile::error(Script,"\'->\' expected");
- }
-LAB_080b0b09:
- TReadScriptFile::nextToken(Script);
- TVar9 = Script->Token;
- if (TVar9 == STRING) {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- TReadScriptFile::getString(Script);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
- goto LAB_080b0be1;
- }
- uVar13 = TVar9 == IDENTIFIER;
- if ((bool)uVar13) {
- pcVar14 = TReadScriptFile::getIdentifier(Script);
- local_28 = 0xffffffff;
- iVar10 = 6;
- pcVar11 = pcVar14;
- pcVar12 = "topic";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 6;
- pcVar11 = pcVar14;
- pcVar12 = "price";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "amount";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 5;
- pcVar11 = pcVar14;
- pcVar12 = "type";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 5;
- pcVar11 = pcVar14;
- pcVar12 = "data";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 3;
- pcVar11 = pcVar14;
- pcVar12 = "hp";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 3;
- }
- iVar10 = 8;
- pcVar11 = pcVar14;
- pcVar12 = "burning";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 8;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "poison";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 8;
- }
- iVar10 = 0xe;
- pcVar11 = pcVar14;
- pcVar12 = "setquestvalue";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 4;
- }
- iVar10 = 9;
- pcVar11 = pcVar14;
- pcVar12 = "effectme";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 10;
- pcVar11 = pcVar14;
- pcVar12 = "effectopp";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 0xb;
- pcVar11 = pcVar14;
- pcVar12 = "profession";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 0xb;
- pcVar11 = pcVar14;
- pcVar12 = "teachspell";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "summon";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "create";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "delete";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 0xc;
- pcVar11 = pcVar14;
- pcVar12 = "createmoney";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 6;
- }
- iVar10 = 0xc;
- pcVar11 = pcVar14;
- pcVar12 = "deletemoney";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 6;
- }
- iVar10 = 6;
- pcVar11 = pcVar14;
- pcVar12 = "queue";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 6;
- }
- iVar10 = 9;
- pcVar11 = pcVar14;
- pcVar12 = "teleport";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 10;
- }
- iVar10 = 0xe;
- pcVar11 = pcVar14;
- pcVar12 = "startposition";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 10;
- }
- iVar10 = 5;
- pcVar11 = pcVar14;
- pcVar12 = "idle";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 7;
- }
- iVar10 = 4;
- pcVar11 = "nop";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar14 == *pcVar11;
- pcVar14 = pcVar14 + 1;
- pcVar11 = pcVar11 + 1;
- } while ((bool)uVar13);
- uVar8 = 0;
- if (!(bool)uVar13) {
- uVar8 = local_28;
- }
- switch(uVar8) {
- case 0:
- goto switchD_080b0f21_caseD_0;
- default:
- pcVar14 = "unknown identifier";
- goto LAB_080b0b38;
- case 2:
- case 3:
- TReadScriptFile::readSymbol(Script,'=');
- TReadScriptFile::nextToken(Script);
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- // try { // try from 080b0f68 to 080b0fb0 has its CatchHandler @ 080b1c72
- Left_12 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_12;
- pTVar4->Right = pTVar3;
- Left_12 = pTVar4;
- }
- // try { // try from 080b0fd2 to 080b1024 has its CatchHandler @ 080b1c87
- while ((TVar9 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_12;
- TVar9 = Script->Token;
- Left_12 = pTVar4;
- }
- // try { // try from 080b1049 to 080b10cb has its CatchHandler @ 080b1d20
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
- goto LAB_080b0b43;
- case 4:
- case 8:
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b12a9 to 080b12f1 has its CatchHandler @ 080b1cd1
- Left_10 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_10;
- pTVar4->Right = pTVar3;
- Left_10 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) goto LAB_080b1384;
- // try { // try from 080b1313 to 080b1365 has its CatchHandler @ 080b1ce6
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ','))
- goto LAB_080b1397;
- goto LAB_080b1384;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_10;
- TVar9 = Script->Token;
- Left_10 = pTVar4;
- } while( true );
- case 5:
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- // try { // try from 080b10dc to 080b1124 has its CatchHandler @ 080b1d05
- local_4c = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = local_4c;
- pTVar4->Right = pTVar3;
- local_4c = pTVar4;
- }
- // try { // try from 080b1146 to 080b1198 has its CatchHandler @ 080b1c4a
- while ((TVar9 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = local_4c;
- TVar9 = Script->Token;
- local_4c = pTVar4;
- }
- // try { // try from 080b11bd to 080b129b has its CatchHandler @ 080b1d20
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
- if ((Script->Token != SPECIAL) ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != ')')) {
- TReadScriptFile::error(Script,") expected");
- }
- goto LAB_080b0be1;
- case 6:
- case 7:
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- goto LAB_080b0bcc;
- case 10:
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b1538 to 080b1580 has its CatchHandler @ 080b1c89
- Left_14 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_14;
- pTVar4->Right = pTVar3;
- Left_14 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) goto LAB_080b1613;
- // try { // try from 080b15a2 to 080b15f4 has its CatchHandler @ 080b1c9e
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ','))
- goto LAB_080b1626;
- goto LAB_080b1613;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_14;
- TVar9 = Script->Token;
- Left_14 = pTVar4;
- } while( true );
- }
- }
- if ((TVar9 == SPECIAL) && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '*')) {
- iVar10 = this->Behaviours;
- if (iVar10 == 0) {
- TReadScriptFile::error(Script,"no previous pattern");
- iVar10 = this->Behaviours;
- }
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,iVar10);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- goto LAB_080b0bcc;
- }
- pcVar14 = "illegal action";
-LAB_080b0b38:
- TReadScriptFile::error(Script,pcVar14);
- goto LAB_080b0b43;
-LAB_080b1613:
- // try { // try from 080b1621 to 080b1630 has its CatchHandler @ 080b1d20
- TReadScriptFile::error(Script,", expected");
-LAB_080b1626:
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b163e to 080b1686 has its CatchHandler @ 080b1ca0
- Left_16 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_16;
- pTVar4->Right = pTVar3;
- Left_16 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) break;
- // try { // try from 080b16a8 to 080b16fa has its CatchHandler @ 080b1cb5
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ',')) goto LAB_080b172c;
- break;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_16;
- TVar9 = Script->Token;
- Left_16 = pTVar4;
- } while( true );
- // try { // try from 080b1727 to 080b1736 has its CatchHandler @ 080b1d20
- TReadScriptFile::error(Script,", expected");
-LAB_080b172c:
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b1744 to 080b178c has its CatchHandler @ 080b1cb7
- Left_8 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_8;
- pTVar4->Right = pTVar3;
- Left_8 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) break;
- // try { // try from 080b17ae to 080b1800 has its CatchHandler @ 080b1ccc
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ')')) goto LAB_080b182e;
- break;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_8;
- TVar9 = Script->Token;
- Left_8 = pTVar4;
- } while( true );
- // try { // try from 080b1829 to 080b1bb7 has its CatchHandler @ 080b1d20
- TReadScriptFile::error(Script,") expected");
-LAB_080b182e:
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
-switchD_080b0f21_caseD_0:
- goto LAB_080b0be1;
-LAB_080b1384:
- // try { // try from 080b1392 to 080b13a1 has its CatchHandler @ 080b1d20
- TReadScriptFile::error(Script,", expected");
-LAB_080b1397:
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b13af to 080b13f7 has its CatchHandler @ 080b1ceb
- local_44 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = local_44;
- pTVar4->Right = pTVar3;
- local_44 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) break;
- // try { // try from 080b1419 to 080b146b has its CatchHandler @ 080b1d00
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ')')) goto LAB_080b1499;
- break;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = local_44;
- TVar9 = Script->Token;
- local_44 = pTVar4;
- } while( true );
- // try { // try from 080b1494 to 080b152a has its CatchHandler @ 080b1d20
- TReadScriptFile::error(Script,") expected");
-LAB_080b1499:
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
-LAB_080b0bcc:
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
-LAB_080b0be1:
- TReadScriptFile::nextToken(Script);
-LAB_080b0b43:
- if ((Script->Token != SPECIAL) || (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != ','))
- goto LAB_080b0b57;
- goto LAB_080b0b09;
-LAB_080b0b57:
- this->Behaviours = this->Behaviours + 1;
- goto LAB_080b0825;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Nr
-// DWARF original prototype: void TBehaviourDatabase(TBehaviourDatabase * this, TReadScriptFile *
-// Script)
-
-void __thiscall
-TBehaviourDatabase::TBehaviourDatabase(TBehaviourDatabase *this,TReadScriptFile *Script)
-
-{
- char cVar1;
- bool bVar2;
- TNode *Node;
- TNode *pTVar3;
- TNode *pTVar4;
- TBehaviour *pTVar5;
- TCondition *pTVar6;
- TAction *pTVar7;
- undefined4 uVar8;
- TOKEN TVar9;
- int iVar10;
- bool Success;
- char *pcVar11;
- TNode *Right;
- char *pcVar12;
- undefined1 uVar13;
- char *pcVar14;
- TNode *local_4c;
- TNode *Left_6;
- TNode *local_44;
- TNode *Left_10;
- TNode *Left_8;
- TNode *Left_16;
- TNode *Left_14;
- TNode *Left_12;
- TNode *Left_4;
- undefined4 local_28;
- int Type;
- TNode *Left_2;
- int Operator;
- TNode *Left;
- int Data;
- int Nr;
-
- // try { // try from 080b1d77 to 080b1d7b has its CatchHandler @ 080b32b0
- vector<TBehaviour>::vector(&this->Behaviour,0,0x32,0x19);
- this->Behaviours = 0;
- // try { // try from 080b1d95 to 080b1da4 has its CatchHandler @ 080b32a0
- TReadScriptFile::readSymbol(Script,'{');
- TReadScriptFile::nextToken(Script);
-LAB_080b1da5:
- TVar9 = Script->Token;
- if (TVar9 != SPECIAL) goto LAB_080b1db3;
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 == '}') {
- return;
- }
- TVar9 = Script->Token;
- if (TVar9 != SPECIAL) goto LAB_080b1db3;
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != 'I') {
-LAB_080b2060:
- TVar9 = Script->Token;
-LAB_080b1db3:
- bVar2 = false;
- if (TVar9 == STRING) {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pcVar14 = TReadScriptFile::getString(Script);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,1,pcVar14);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- TVar9 = Script->Token;
- }
- if (TVar9 == IDENTIFIER) {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pcVar14 = TReadScriptFile::getIdentifier(Script);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,2,pcVar14);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- TVar9 = Script->Token;
- }
- if (TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 == '!') {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,5,(void *)0x0);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- TVar9 = Script->Token;
- }
- else {
- TVar9 = Script->Token;
- }
- if ((TVar9 == SPECIAL) && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '%')) {
- Data = TReadScriptFile::readNumber(Script);
- if (2 < Data - 1U) {
- TReadScriptFile::error(Script,"illegal ordinal number");
- }
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,3,&Data);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
- }
- }
- if (!bVar2) {
- // try { // try from 080b1de5 to 080b1e2d has its CatchHandler @ 080b3150
- Operator = (int)readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = (TNode *)Operator;
- pTVar4->Right = pTVar3;
- Operator = (int)pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) goto LAB_080b1ebc;
- // try { // try from 080b1e4f to 080b1ea1 has its CatchHandler @ 080b31ca
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if (Script->Token == SPECIAL) goto LAB_080b1ecf;
- goto LAB_080b1ebc;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = (TNode *)Operator;
- TVar9 = Script->Token;
- Operator = (int)pTVar4;
- } while( true );
- }
- TReadScriptFile::nextToken(Script);
- goto LAB_080b2041;
- }
- goto LAB_080b2089;
-LAB_080b1ebc:
- // try { // try from 080b1eca to 080b1f06 has its CatchHandler @ 080b32a0
- TReadScriptFile::error(Script,"relational operator expected");
-LAB_080b1ecf:
- Left_2 = (TNode *)0x0;
- cVar1 = TReadScriptFile::getSpecial(Script);
- switch(cVar1) {
- case '<':
- Left_2 = (TNode *)0x1;
- break;
- case '=':
- Left_2 = (TNode *)0x3;
- break;
- case '>':
- Left_2 = (TNode *)0x2;
- break;
- default:
- TReadScriptFile::error(Script,"relational operator expected");
- break;
- case 'G':
- Left_2 = (TNode *)0x6;
- break;
- case 'L':
- Left_2 = (TNode *)0x5;
- break;
- case 'N':
- Left_2 = (TNode *)0x4;
- }
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b1f14 to 080b1f59 has its CatchHandler @ 080b31db
- Type = (int)readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = (TNode *)Type;
- pTVar4->Right = pTVar3;
- Type = (int)pTVar4;
- }
- // try { // try from 080b1f7b to 080b1fcd has its CatchHandler @ 080b31f0
- while ((TVar9 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = (TNode *)Type;
- TVar9 = Script->Token;
- Type = (int)pTVar4;
- }
- // try { // try from 080b1fe8 to 080b24da has its CatchHandler @ 080b32a0
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (int)Left_2;
- pTVar3->Left = (TNode *)Operator;
- pTVar3->Right = (TNode *)Type;
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar6 = vector<TCondition>::operator()(&pTVar5->Condition,pTVar5->Conditions);
- bVar2 = TCondition::set(pTVar6,4,pTVar3);
- if (bVar2) {
- pTVar5->Conditions = pTVar5->Conditions + 1;
- }
-LAB_080b2041:
- if (Script->Token != SPECIAL) goto LAB_080b2076;
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != ',') goto LAB_080b206a;
- TReadScriptFile::nextToken(Script);
- goto LAB_080b2060;
-LAB_080b206a:
- if ((Script->Token != SPECIAL) || (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != 'I')) {
-LAB_080b2076:
- TReadScriptFile::error(Script,"\'->\' expected");
- }
-LAB_080b2089:
- TReadScriptFile::nextToken(Script);
- TVar9 = Script->Token;
- if (TVar9 == STRING) {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- TReadScriptFile::getString(Script);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
- goto LAB_080b2161;
- }
- uVar13 = TVar9 == IDENTIFIER;
- if ((bool)uVar13) {
- pcVar14 = TReadScriptFile::getIdentifier(Script);
- local_28 = 0xffffffff;
- iVar10 = 6;
- pcVar11 = pcVar14;
- pcVar12 = "topic";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 6;
- pcVar11 = pcVar14;
- pcVar12 = "price";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "amount";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 5;
- pcVar11 = pcVar14;
- pcVar12 = "type";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 5;
- pcVar11 = pcVar14;
- pcVar12 = "data";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 2;
- }
- iVar10 = 3;
- pcVar11 = pcVar14;
- pcVar12 = "hp";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 3;
- }
- iVar10 = 8;
- pcVar11 = pcVar14;
- pcVar12 = "burning";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 8;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "poison";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 8;
- }
- iVar10 = 0xe;
- pcVar11 = pcVar14;
- pcVar12 = "setquestvalue";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 4;
- }
- iVar10 = 9;
- pcVar11 = pcVar14;
- pcVar12 = "effectme";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 10;
- pcVar11 = pcVar14;
- pcVar12 = "effectopp";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 0xb;
- pcVar11 = pcVar14;
- pcVar12 = "profession";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 0xb;
- pcVar11 = pcVar14;
- pcVar12 = "teachspell";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "summon";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "create";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 7;
- pcVar11 = pcVar14;
- pcVar12 = "delete";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 5;
- }
- iVar10 = 0xc;
- pcVar11 = pcVar14;
- pcVar12 = "createmoney";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 6;
- }
- iVar10 = 0xc;
- pcVar11 = pcVar14;
- pcVar12 = "deletemoney";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 6;
- }
- iVar10 = 6;
- pcVar11 = pcVar14;
- pcVar12 = "queue";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 6;
- }
- iVar10 = 9;
- pcVar11 = pcVar14;
- pcVar12 = "teleport";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 10;
- }
- iVar10 = 0xe;
- pcVar11 = pcVar14;
- pcVar12 = "startposition";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 10;
- }
- iVar10 = 5;
- pcVar11 = pcVar14;
- pcVar12 = "idle";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar11 == *pcVar12;
- pcVar11 = pcVar11 + 1;
- pcVar12 = pcVar12 + 1;
- } while ((bool)uVar13);
- if ((bool)uVar13) {
- local_28 = 7;
- }
- iVar10 = 4;
- pcVar11 = "nop";
- do {
- if (iVar10 == 0) break;
- iVar10 = iVar10 + -1;
- uVar13 = *pcVar14 == *pcVar11;
- pcVar14 = pcVar14 + 1;
- pcVar11 = pcVar11 + 1;
- } while ((bool)uVar13);
- uVar8 = 0;
- if (!(bool)uVar13) {
- uVar8 = local_28;
- }
- switch(uVar8) {
- case 0:
- goto switchD_080b24a1_caseD_0;
- default:
- pcVar14 = "unknown identifier";
- goto LAB_080b20b8;
- case 2:
- case 3:
- TReadScriptFile::readSymbol(Script,'=');
- TReadScriptFile::nextToken(Script);
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- // try { // try from 080b24e8 to 080b2530 has its CatchHandler @ 080b31f2
- Left_12 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_12;
- pTVar4->Right = pTVar3;
- Left_12 = pTVar4;
- }
- // try { // try from 080b2552 to 080b25a4 has its CatchHandler @ 080b3207
- while ((TVar9 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_12;
- TVar9 = Script->Token;
- Left_12 = pTVar4;
- }
- // try { // try from 080b25c9 to 080b264b has its CatchHandler @ 080b32a0
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
- goto LAB_080b20c3;
- case 4:
- case 8:
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b2829 to 080b2871 has its CatchHandler @ 080b3251
- Left_10 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_10;
- pTVar4->Right = pTVar3;
- Left_10 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) goto LAB_080b2904;
- // try { // try from 080b2893 to 080b28e5 has its CatchHandler @ 080b3266
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ','))
- goto LAB_080b2917;
- goto LAB_080b2904;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_10;
- TVar9 = Script->Token;
- Left_10 = pTVar4;
- } while( true );
- case 5:
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- // try { // try from 080b265c to 080b26a4 has its CatchHandler @ 080b3285
- local_4c = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = local_4c;
- pTVar4->Right = pTVar3;
- local_4c = pTVar4;
- }
- // try { // try from 080b26c6 to 080b2718 has its CatchHandler @ 080b31ca
- while ((TVar9 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = local_4c;
- TVar9 = Script->Token;
- local_4c = pTVar4;
- }
- // try { // try from 080b273d to 080b281b has its CatchHandler @ 080b32a0
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
- if ((Script->Token != SPECIAL) ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != ')')) {
- TReadScriptFile::error(Script,") expected");
- }
- goto LAB_080b2161;
- case 6:
- case 7:
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- goto LAB_080b214c;
- case 10:
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b2ab8 to 080b2b00 has its CatchHandler @ 080b3209
- Left_14 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_14;
- pTVar4->Right = pTVar3;
- Left_14 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) goto LAB_080b2b93;
- // try { // try from 080b2b22 to 080b2b74 has its CatchHandler @ 080b321e
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ','))
- goto LAB_080b2ba6;
- goto LAB_080b2b93;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_14;
- TVar9 = Script->Token;
- Left_14 = pTVar4;
- } while( true );
- }
- }
- if ((TVar9 == SPECIAL) && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '*')) {
- iVar10 = this->Behaviours;
- if (iVar10 == 0) {
- TReadScriptFile::error(Script,"no previous pattern");
- iVar10 = this->Behaviours;
- }
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,iVar10);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- goto LAB_080b214c;
- }
- pcVar14 = "illegal action";
-LAB_080b20b8:
- TReadScriptFile::error(Script,pcVar14);
- goto LAB_080b20c3;
-LAB_080b2b93:
- // try { // try from 080b2ba1 to 080b2bb0 has its CatchHandler @ 080b32a0
- TReadScriptFile::error(Script,", expected");
-LAB_080b2ba6:
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b2bbe to 080b2c06 has its CatchHandler @ 080b3220
- Left_16 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_16;
- pTVar4->Right = pTVar3;
- Left_16 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) break;
- // try { // try from 080b2c28 to 080b2c7a has its CatchHandler @ 080b3235
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ',')) goto LAB_080b2cac;
- break;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_16;
- TVar9 = Script->Token;
- Left_16 = pTVar4;
- } while( true );
- // try { // try from 080b2ca7 to 080b2cb6 has its CatchHandler @ 080b32a0
- TReadScriptFile::error(Script,", expected");
-LAB_080b2cac:
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b2cc4 to 080b2d0c has its CatchHandler @ 080b3237
- Left_8 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = Left_8;
- pTVar4->Right = pTVar3;
- Left_8 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) break;
- // try { // try from 080b2d2e to 080b2d80 has its CatchHandler @ 080b324c
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ')')) goto LAB_080b2dae;
- break;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = Left_8;
- TVar9 = Script->Token;
- Left_8 = pTVar4;
- } while( true );
- // try { // try from 080b2da9 to 080b3137 has its CatchHandler @ 080b32a0
- TReadScriptFile::error(Script,") expected");
-LAB_080b2dae:
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
-switchD_080b24a1_caseD_0:
- goto LAB_080b2161;
-LAB_080b2904:
- // try { // try from 080b2912 to 080b2921 has its CatchHandler @ 080b32a0
- TReadScriptFile::error(Script,", expected");
-LAB_080b2917:
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b292f to 080b2977 has its CatchHandler @ 080b326b
- local_44 = readValue(this,Script);
- while (TVar9 = Script->Token, TVar9 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar9 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = local_44;
- pTVar4->Right = pTVar3;
- local_44 = pTVar4;
- }
- do {
- if (TVar9 != SPECIAL) break;
- // try { // try from 080b2999 to 080b29eb has its CatchHandler @ 080b3280
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ')')) goto LAB_080b2a19;
- break;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar3 = readFactor(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = (cVar1 != '+') + 7;
- pTVar4->Right = pTVar3;
- pTVar4->Left = local_44;
- TVar9 = Script->Token;
- local_44 = pTVar4;
- } while( true );
- // try { // try from 080b2a14 to 080b2aaa has its CatchHandler @ 080b32a0
- TReadScriptFile::error(Script,") expected");
-LAB_080b2a19:
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,this->Behaviours);
- pTVar7 = vector<TAction>::operator()(&pTVar5->Action,pTVar5->Actions);
-LAB_080b214c:
- bVar2 = TAction::set(pTVar7);
- if (bVar2) {
- pTVar5->Actions = pTVar5->Actions + 1;
- }
-LAB_080b2161:
- TReadScriptFile::nextToken(Script);
-LAB_080b20c3:
- if ((Script->Token != SPECIAL) || (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != ','))
- goto LAB_080b20d7;
- goto LAB_080b2089;
-LAB_080b20d7:
- this->Behaviours = this->Behaviours + 1;
- goto LAB_080b1da5;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Left
-// DWARF original prototype: TNode * readValue(TBehaviourDatabase * this, TReadScriptFile * Script)
-
-TNode * __thiscall TBehaviourDatabase::readValue(TBehaviourDatabase *this,TReadScriptFile *Script)
-
-{
- char cVar1;
- TNode *Node_1;
- TNode *pTVar2;
- TNode *pTVar3;
- TOKEN TVar4;
- int iVar5;
- TNode *Left_1;
- TNode *Right;
- char *pcVar6;
- undefined1 uVar7;
- char *pcVar8;
- TNode *local_2c;
- TNode *Node;
- TNode *Left_10;
- TNode *Left_8;
- TNode *Left_6;
- TNode *Left_4;
- TNode *Left_2;
- TNode *Left;
-
- local_2c = (TNode *)0x0;
- TVar4 = Script->Token;
- if (TVar4 == NUMBER) {
- iVar5 = TReadScriptFile::getNumber(Script);
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xb;
-LAB_080b3db2:
- local_2c->Data = iVar5;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- goto LAB_080b3310;
- }
- if ((int)TVar4 < 3) {
- uVar7 = TVar4 == IDENTIFIER;
- if (!(bool)uVar7) goto LAB_080b3300;
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 6;
- pcVar6 = "topic";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xc;
- local_2c->Data = 0;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 6;
- pcVar6 = "price";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xd;
- local_2c->Data = 0;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 7;
- pcVar6 = "amount";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xe;
- local_2c->Data = 0;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 6;
- pcVar6 = "level";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xf;
- local_2c->Data = 0;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 9;
- pcVar6 = "maglevel";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xf;
- local_2c->Data = 1;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 3;
- pcVar6 = "hp";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xf;
- local_2c->Data = 2;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 8;
- pcVar6 = "burning";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xf;
- local_2c->Data = 0x12;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 7;
- pcVar6 = "poison";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0xf;
- local_2c->Data = 0x11;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 6;
- pcVar6 = "count";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b347a to 080b34b9 has its CatchHandler @ 080b3de7
- Left_2 = readValue(this,Script);
- while (TVar4 = Script->Token, TVar4 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar4 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar2 = readValue(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = 9;
- pTVar3->Left = Left_2;
- pTVar3->Right = pTVar2;
- Left_2 = pTVar3;
- }
- // try { // try from 080b34d5 to 080b3522 has its CatchHandler @ 080b3e00
- while ((TVar4 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar2 = readFactor(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (cVar1 != '+') + 7;
- pTVar3->Right = pTVar2;
- pTVar3->Left = Left_2;
- TVar4 = Script->Token;
- Left_2 = pTVar3;
- }
- // try { // try from 080b353d to 080b360e has its CatchHandler @ 080b3e50
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x10;
- }
- else {
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 0xb;
- pcVar6 = "countmoney";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x11;
- local_2c->Data = 0;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 5;
- pcVar6 = "type";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x12;
- local_2c->Data = 0;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 5;
- pcVar6 = "data";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x13;
- local_2c->Data = 0;
- local_2c->Left = (TNode *)0x0;
- local_2c->Right = (TNode *)0x0;
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 0xb;
- pcVar6 = "spellknown";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b3619 to 080b3658 has its CatchHandler @ 080b3e0b
- Left_4 = readValue(this,Script);
- while (TVar4 = Script->Token, TVar4 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar4 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar2 = readValue(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = 9;
- pTVar3->Left = Left_4;
- pTVar3->Right = pTVar2;
- Left_4 = pTVar3;
- }
- // try { // try from 080b3674 to 080b36c1 has its CatchHandler @ 080b3e16
- while ((TVar4 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar2 = readFactor(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (cVar1 != '+') + 7;
- pTVar3->Right = pTVar2;
- pTVar3->Left = Left_4;
- TVar4 = Script->Token;
- Left_4 = pTVar3;
- }
- // try { // try from 080b36dc to 080b3725 has its CatchHandler @ 080b3e50
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x14;
- Left_2 = Left_4;
- }
- else {
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 0xb;
- pcVar6 = "spelllevel";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b3730 to 080b376f has its CatchHandler @ 080b3e18
- Left_6 = readValue(this,Script);
- while (TVar4 = Script->Token, TVar4 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar4 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar2 = readValue(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = 9;
- pTVar3->Left = Left_6;
- pTVar3->Right = pTVar2;
- Left_6 = pTVar3;
- }
- // try { // try from 080b378b to 080b37d8 has its CatchHandler @ 080b3e23
- while ((TVar4 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar2 = readFactor(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (cVar1 != '+') + 7;
- pTVar3->Right = pTVar2;
- pTVar3->Left = Left_6;
- TVar4 = Script->Token;
- Left_6 = pTVar3;
- }
- // try { // try from 080b37f3 to 080b383c has its CatchHandler @ 080b3e50
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x15;
- Left_2 = Left_6;
- }
- else {
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 7;
- pcVar6 = "random";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if ((bool)uVar7) {
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b3847 to 080b3886 has its CatchHandler @ 080b3e25
- Left_8 = readValue(this,Script);
- while (TVar4 = Script->Token, TVar4 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar4 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar2 = readValue(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = 9;
- pTVar3->Left = Left_8;
- pTVar3->Right = pTVar2;
- Left_8 = pTVar3;
- }
- do {
- if (TVar4 != SPECIAL) goto LAB_080b390b;
- // try { // try from 080b38a2 to 080b38ef has its CatchHandler @ 080b3e30
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ','))
- goto LAB_080b391b;
- goto LAB_080b390b;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar2 = readFactor(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (cVar1 != '+') + 7;
- pTVar3->Right = pTVar2;
- pTVar3->Left = Left_8;
- TVar4 = Script->Token;
- Left_8 = pTVar3;
- } while( true );
- }
- pcVar8 = TReadScriptFile::getIdentifier(Script);
- iVar5 = 0xb;
- pcVar6 = "questvalue";
- do {
- if (iVar5 == 0) break;
- iVar5 = iVar5 + -1;
- uVar7 = *pcVar8 == *pcVar6;
- pcVar8 = pcVar8 + 1;
- pcVar6 = pcVar6 + 1;
- } while ((bool)uVar7);
- if (!(bool)uVar7) goto LAB_080b3310;
- TReadScriptFile::readSymbol(Script,'(');
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b3a88 to 080b3ac7 has its CatchHandler @ 080b3e3f
- Node = readValue(this,Script);
- while (TVar4 = Script->Token, TVar4 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar4 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar2 = readValue(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = 9;
- pTVar3->Left = Node;
- pTVar3->Right = pTVar2;
- Node = pTVar3;
- }
- // try { // try from 080b3ae3 to 080b3b30 has its CatchHandler @ 080b3e00
- while ((TVar4 == SPECIAL &&
- ((cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '+' ||
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == '-'))))) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar2 = readFactor(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (cVar1 != '+') + 7;
- pTVar3->Right = pTVar2;
- pTVar3->Left = Node;
- TVar4 = Script->Token;
- Node = pTVar3;
- }
- // try { // try from 080b3b4b to 080b3dde has its CatchHandler @ 080b3e50
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x17;
- Left_2 = Node;
- }
- }
- }
- local_2c->Left = Left_2;
- local_2c->Right = (TNode *)0x0;
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ')')) goto LAB_080b3310;
- pcVar8 = ") expected";
- }
- else {
- if (TVar4 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '%') {
- TReadScriptFile::error(Script,"illegal character");
- }
- iVar5 = TReadScriptFile::readNumber(Script);
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 10;
- goto LAB_080b3db2;
- }
-LAB_080b3300:
- pcVar8 = "illegal value";
- }
- // try { // try from 080b330b to 080b346f has its CatchHandler @ 080b3e50
- TReadScriptFile::error(Script,pcVar8);
-LAB_080b3310:
- if (local_2c == (TNode *)0x0) {
- TReadScriptFile::error(Script,"unknown value");
- }
- TReadScriptFile::nextToken(Script);
- return local_2c;
-LAB_080b390b:
- // try { // try from 080b3916 to 080b3922 has its CatchHandler @ 080b3e50
- TReadScriptFile::error(Script,", expected");
-LAB_080b391b:
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b392d to 080b396c has its CatchHandler @ 080b3e32
- Left_10 = readValue(this,Script);
- while (TVar4 = Script->Token, TVar4 == SPECIAL) {
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') {
- TVar4 = Script->Token;
- break;
- }
- TReadScriptFile::nextToken(Script);
- pTVar2 = readValue(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = 9;
- pTVar3->Left = Left_10;
- pTVar3->Right = pTVar2;
- Left_10 = pTVar3;
- }
- do {
- if (TVar4 != SPECIAL) break;
- // try { // try from 080b3988 to 080b39d5 has its CatchHandler @ 080b3e3d
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- if ((Script->Token == SPECIAL) &&
- (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 == ')')) goto LAB_080b39fd;
- break;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- pTVar2 = readFactor(this,Script);
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Type = (cVar1 != '+') + 7;
- pTVar3->Right = pTVar2;
- pTVar3->Left = Left_10;
- TVar4 = Script->Token;
- Left_10 = pTVar3;
- } while( true );
- // try { // try from 080b39f8 to 080b3a7d has its CatchHandler @ 080b3e50
- TReadScriptFile::error(Script,") expected");
-LAB_080b39fd:
- local_2c = store<TNode,256>::getFreeItem(NodeTable);
- local_2c->Type = 0x16;
- local_2c->Left = Left_8;
- local_2c->Right = Left_10;
- goto LAB_080b3310;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Right
-// DWARF original prototype: TNode * readFactor(TBehaviourDatabase * this, TReadScriptFile * Script)
-
-TNode * __thiscall TBehaviourDatabase::readFactor(TBehaviourDatabase *this,TReadScriptFile *Script)
-
-{
- char cVar1;
- TNode *Node;
- TNode *pTVar2;
- TNode *pTVar3;
- TNode *pTVar4;
- TNode *Left;
- TNode *Right;
-
- // try { // try from 080b3e7c to 080b3eb7 has its CatchHandler @ 080b3ed8
- pTVar2 = readValue(this,Script);
- while( true ) {
- if (Script->Token != SPECIAL) {
- return pTVar2;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') break;
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar4 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar4->Type = 9;
- pTVar4->Left = pTVar2;
- pTVar4->Right = pTVar3;
- pTVar2 = pTVar4;
- }
- return pTVar2;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Right
-// DWARF original prototype: TNode * readTerm(TBehaviourDatabase * this, TReadScriptFile * Script)
-
-TNode * __thiscall TBehaviourDatabase::readTerm(TBehaviourDatabase *this,TReadScriptFile *Script)
-
-{
- char cVar1;
- char cVar2;
- TNode *Node;
- TNode *pTVar3;
- TNode *pTVar4;
- TNode *pTVar5;
- TOKEN TVar6;
- TNode *pTVar7;
- TNode *Left;
- TNode *Right_1;
- TNode *Left_2;
- int Operator;
- TNode *Right;
-
- // try { // try from 080b3f0c to 080b3f49 has its CatchHandler @ 080b4030
- pTVar3 = readValue(this,Script);
- while( true ) {
- TVar6 = Script->Token;
- pTVar4 = pTVar3;
- if (TVar6 != SPECIAL) goto LAB_080b3f5d;
- cVar1 = TReadScriptFile::getSpecial(Script);
- if (cVar1 != '*') break;
- TReadScriptFile::nextToken(Script);
- pTVar4 = readValue(this,Script);
- pTVar5 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar5->Type = 9;
- pTVar5->Left = pTVar3;
- pTVar5->Right = pTVar4;
- pTVar3 = pTVar5;
- }
- while( true ) {
- TVar6 = Script->Token;
- pTVar4 = pTVar3;
-LAB_080b3f5d:
- if (TVar6 != SPECIAL) break;
- // try { // try from 080b3f69 to 080b3fa0 has its CatchHandler @ 080b4048
- cVar1 = TReadScriptFile::getSpecial(Script);
- if ((cVar1 != '+') && (cVar1 = TReadScriptFile::getSpecial(Script), cVar1 != '-')) {
- return pTVar4;
- }
- cVar1 = TReadScriptFile::getSpecial(Script);
- TReadScriptFile::nextToken(Script);
- // try { // try from 080b3fa8 to 080b3fe4 has its CatchHandler @ 080b4030
- pTVar5 = readValue(this,Script);
- while ((Script->Token == SPECIAL &&
- (cVar2 = TReadScriptFile::getSpecial(Script), cVar2 == '*'))) {
- TReadScriptFile::nextToken(Script);
- pTVar3 = readValue(this,Script);
- pTVar7 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar7->Type = 9;
- pTVar7->Left = pTVar5;
- pTVar7->Right = pTVar3;
- pTVar5 = pTVar7;
- }
- // try { // try from 080b4001 to 080b4005 has its CatchHandler @ 080b4048
- pTVar3 = store<TNode,256>::getFreeItem(NodeTable);
- pTVar3->Left = pTVar4;
- pTVar3->Type = (cVar1 != '+') + 7;
- pTVar3->Right = pTVar5;
- }
- return pTVar4;
-}
-
-
-
-// DWARF original prototype: int evaluate(TBehaviourDatabase * this, TNPC * npc, TNode * Node, int *
-// Number)
-
-int __thiscall
-TBehaviourDatabase::evaluate(TBehaviourDatabase *this,TNPC *npc,TNode *Node,int *Number)
-
-{
- TSkill *pTVar1;
- bool bVar2;
- TPlayer *this_00;
- uint uVar3;
- int iVar4;
- int iVar5;
- TPlayer *Opp;
- char *pcVar6;
- ObjectType local_2c [7];
-
- if (Node == (TNode *)0x0) {
- pcVar6 = "TBehaviourDatabase::evaluate: Knoten existiert nicht.\n";
-LAB_080b4560:
- error(pcVar6);
- goto LAB_080b4130;
- }
- if (Number == (int *)0x0) {
- pcVar6 = "TBehaviourDatabase::evaluate: Zahlen existieren nicht.\n";
- goto LAB_080b4560;
- }
- if (npc == (TNPC *)0x0) {
- pcVar6 = "TBehaviourDatabase::evaluate: NPC existiert nicht.\n";
- goto LAB_080b4560;
- }
- this_00 = GetPlayer(npc->Interlocutor);
- if (this_00 == (TPlayer *)0x0) {
- pcVar6 = &DAT_08104c40;
- goto LAB_080b4560;
- }
- iVar5 = Node->Type;
- switch(iVar5) {
- default:
- pcVar6 = &DAT_08104b40;
- goto LAB_080b412b;
- case 1:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- bVar2 = iVar5 < iVar4;
- goto LAB_080b4100;
- case 2:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- bVar2 = iVar4 < iVar5;
- goto LAB_080b4100;
- case 3:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- bVar2 = iVar5 == iVar4;
- goto LAB_080b4100;
- case 4:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- bVar2 = iVar5 == iVar4;
- goto LAB_080b41fb;
- case 5:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- bVar2 = iVar5 <= iVar4;
- goto LAB_080b4100;
- case 6:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- bVar2 = iVar4 <= iVar5;
- goto LAB_080b4100;
- case 7:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- uVar3 = iVar4 + iVar5;
- break;
- case 8:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- uVar3 = iVar5 - iVar4;
- break;
- case 9:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- iVar4 = evaluate(this,npc,Node->Right,Number);
- uVar3 = iVar4 * iVar5;
- break;
- case 10:
- iVar5 = Node->Data;
- if (iVar5 - 1U < 3) {
- if (-1 < Number[iVar5 + -1]) {
- return Number[iVar5 + -1];
- }
- pcVar6 = "TBehaviourDatabase::evaluate: Zahl-Parameter %d nicht belegt.\n";
- }
- else {
- pcVar6 = &DAT_08104bc0;
- }
- goto LAB_080b412b;
- case 0xb:
- uVar3 = Node->Data;
- break;
- case 0xc:
- uVar3 = npc->Topic;
- break;
- case 0xd:
- uVar3 = npc->Price;
- break;
- case 0xe:
- uVar3 = npc->Amount;
- break;
- case 0xf:
- iVar5 = Node->Data;
- if (-1 < iVar5) {
- if (iVar5 < 3) {
- iVar5 = TSkill::Get((this_00->super_TCreature).super_TSkillBase.Skills[iVar5]);
- return iVar5;
- }
- if (iVar5 - 0x11U < 2) {
- pTVar1 = (this_00->super_TCreature).super_TSkillBase.Skills[iVar5];
- iVar5 = (*pTVar1->_vptr_TSkill[0xd])(pTVar1);
- return iVar5;
- }
- }
- pcVar6 = &DAT_08104c00;
-LAB_080b412b:
- error(pcVar6,iVar5);
-LAB_080b4130:
- uVar3 = 0;
- break;
- case 0x10:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- ObjectType::setTypeID(local_2c,iVar5);
- uVar3 = CountInventoryObjects(npc->Interlocutor,local_2c,npc->Data);
- break;
- case 0x11:
- uVar3 = CountInventoryMoney(npc->Interlocutor);
- break;
- case 0x12:
- uVar3 = npc->TypeID;
- break;
- case 0x13:
- uVar3 = npc->Data;
- break;
- case 0x14:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- bVar2 = TPlayer::SpellKnown(this_00,iVar5);
- bVar2 = !bVar2;
-LAB_080b41fb:
- bVar2 = !bVar2;
-LAB_080b4100:
- uVar3 = (uint)bVar2;
- break;
- case 0x15:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- uVar3 = GetSpellLevel(iVar5);
- break;
- case 0x16:
- evaluate(this,npc,Node->Right,Number);
- evaluate(this,npc,Node->Left,Number);
- uVar3 = random();
- break;
- case 0x17:
- iVar5 = evaluate(this,npc,Node->Left,Number);
- uVar3 = TPlayer::GetQuestValue(this_00,iVar5);
- }
- return uVar3;
-}
-
-
-
-// DWARF original prototype: void react(TBehaviourDatabase * this, TNPC * npc, char * Text,
-// SITUATION Situation)
-
-void __thiscall
-TBehaviourDatabase::react(TBehaviourDatabase *this,TNPC *npc,char *Text,SITUATION Situation)
-
-{
- char cVar1;
- TSkill *pTVar2;
- byte bVar3;
- uchar uVar4;
- RESULT r_1;
- TPlayer *this_00;
- TBehaviour *pTVar5;
- TAction *pTVar6;
- size_t sVar7;
- ulong uVar8;
- TMonster *this_01;
- int iVar9;
- int iVar10;
- int iVar11;
- TCondition *pTVar12;
- undefined4 uVar13;
- uint *puVar14;
- uint *puVar15;
- RESULT r;
- uint uVar16;
- uint uVar17;
- TPlayer *pTVar18;
- int Value3;
- TAction *A;
- uint uVar19;
- int Value;
- bool bVar20;
- bool bVar21;
- char *pcVar22;
- char *pcVar23;
- ObjectType *Type;
- TNPC *pTVar24;
- int Crystal;
- int Value2;
- char *AText;
- int j;
- TBehaviour *B;
- int TalkDelay;
- int iStack_1cc;
- bool StartToDo;
- int j_1;
- bool fulfilled;
- TBehaviour *B_1;
- int i;
- int bestPattern;
- int maxConditions;
- TPlayer *Opp;
- int local_1ac;
- int local_1a8;
- int local_1a4;
- int Hour;
- int Minute;
- char Help [50];
- char acStack_15f [3];
- uint local_15c;
- char Response [300];
- int local_2c;
- int Numbers [3];
-
- if (npc == (TNPC *)0x0) {
- pcVar22 = "TBehaviourDatabase::react: NPC existiert nicht.\n";
- }
- else {
- if (Text != (char *)0x0) {
- this_00 = GetPlayer(npc->Interlocutor);
- if (this_00 == (TPlayer *)0x0) {
- error(&DAT_08105220,Text,Situation);
- return;
- }
- local_2c = -1;
- Numbers[0] = -1;
- bestPattern = -1;
- i = -1;
- Numbers[1] = -1;
- B_1 = (TBehaviour *)0x0;
- if (0 < this->Behaviours) {
- do {
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,(int)B_1);
- iStack_1cc = 0;
- bVar21 = true;
- iVar9 = pTVar5->Conditions;
- pcVar22 = Text;
- if (iVar9 < 1) {
-LAB_080b5354:
- if ((bVar21) && (bestPattern < iVar9)) {
- i = (int)B_1;
- bestPattern = iVar9;
- }
- }
- else {
- do {
- pTVar12 = vector<TCondition>::operator()(&pTVar5->Condition,iStack_1cc);
- switch(pTVar12->Type) {
- case 1:
- pcVar23 = GetDynamicString(pTVar12->Text);
- pcVar23 = SearchForWord(pcVar23,pcVar22);
- if (pcVar23 == (char *)0x0) {
-LAB_080b5379:
- bVar21 = false;
- }
- else {
- pcVar22 = GetDynamicString(pTVar12->Text);
- sVar7 = strlen(pcVar22);
- pcVar22 = pcVar23 + sVar7;
- }
- break;
- case 2:
- iVar9 = pTVar12->Property;
- if (((iVar9 == 1) && (Situation != ADDRESS)) &&
- (Situation != ADDRESSQUEUE)) {
- bVar21 = false;
- }
- if ((iVar9 == 2) && (Situation != BUSY)) {
- bVar21 = false;
- }
- if ((iVar9 == 3) && (Situation != VANISH)) {
- bVar21 = false;
- }
- if ((iVar9 == 4) && ((this_00->super_TCreature).Sex != 1)) {
- bVar21 = false;
- }
- if ((iVar9 == 5) && ((this_00->super_TCreature).Sex != 2)) {
- bVar21 = false;
- }
- if (iVar9 == 6) {
- uVar4 = TPlayer::GetEffectiveProfession(this_00);
- if (uVar4 != '\x01') {
- bVar21 = false;
- }
- iVar9 = pTVar12->Property;
- }
- if (iVar9 == 7) {
- uVar4 = TPlayer::GetEffectiveProfession(this_00);
- if (uVar4 != '\x02') {
- bVar21 = false;
- }
- iVar9 = pTVar12->Property;
- }
- if (iVar9 == 8) {
- uVar4 = TPlayer::GetEffectiveProfession(this_00);
- if (uVar4 != '\x03') {
- bVar21 = false;
- }
- iVar9 = pTVar12->Property;
- }
- if (iVar9 == 9) {
- uVar4 = TPlayer::GetEffectiveProfession(this_00);
- if (uVar4 != '\x04') {
- bVar21 = false;
- }
- iVar9 = pTVar12->Property;
- }
- if (iVar9 == 10) {
- bVar20 = CheckRight((this_00->super_TCreature).ID,
- PREMIUM_ACCOUNT);
- if (!bVar20) {
- bVar21 = false;
- }
- iVar9 = pTVar12->Property;
- }
- if (iVar9 == 0xb) {
- bVar3 = TPlayer::GetRealProfession(this_00);
- if (bVar3 < 10) {
- bVar21 = false;
- }
- iVar9 = pTVar12->Property;
- }
- if ((iVar9 == 0xc) &&
- ((this_00->super_TCreature).EarliestProtectionZoneRound <=
- RoundNr)) {
- bVar21 = false;
- }
- if ((iVar9 == 0xd) && (WorldType != NON_PVP)) {
- bVar21 = false;
- }
- if ((iVar9 == 0xe) && (WorldType != PVP_ENFORCED))
- goto LAB_080b5379;
- break;
- case 3:
- pcVar23 = SearchForNumber(pTVar12->Number,pcVar22);
- if (pcVar23 == (char *)0x0) goto LAB_080b5379;
- iVar9 = pTVar12->Number;
- uVar13 = __strtol_internal(pcVar23,0,10,0);
- *(undefined4 *)(Response + iVar9 * 4 + 0x128) = uVar13;
- if (500 < *(int *)(Response + pTVar12->Number * 4 + 0x128)) {
- pcVar22 = Response + pTVar12->Number * 4 + 0x128;
- pcVar22[0] = -0xc;
- pcVar22[1] = '\x01';
- pcVar22[2] = '\0';
- pcVar22[3] = '\0';
- }
- pcVar22 = pcVar23 + 1;
- break;
- case 4:
- iVar9 = evaluate(this,npc,pTVar12->Expression,&local_2c);
- if (iVar9 == 0) goto LAB_080b5379;
- break;
- case 5:
- i = (int)B_1;
- goto LAB_080b4622;
- }
- iStack_1cc = iStack_1cc + 1;
- iVar9 = pTVar5->Conditions;
- if (iVar9 <= iStack_1cc) goto LAB_080b5354;
- } while (bVar21);
- }
- B_1 = (TBehaviour *)((int)&(B_1->Condition).min + 1);
- } while ((int)B_1 < this->Behaviours);
- }
- if (bestPattern == -1) {
- return;
- }
-LAB_080b4622:
- if (Situation != BUSY) {
- npc->Topic = 0;
- }
- bVar21 = false;
- B = (TBehaviour *)0x3e8;
-LAB_080b4645:
- pTVar5 = vector<TBehaviour>::operator()(&this->Behaviour,i);
- AText = (char *)0x0;
- if (pTVar5->Actions < 1) {
-LAB_080b479b:
- if (!bVar21) {
- return;
- }
- TCreature::ToDoWait((TCreature *)npc,(int)B);
- TCreature::ToDoStart((TCreature *)npc);
- if (Situation == BUSY) {
- return;
- }
- npc->LastTalk = (int)B / 1000 + RoundNr;
- return;
- }
- do {
- pTVar24 = (TNPC *)AText;
- pTVar6 = vector<TAction>::operator()(&pTVar5->Action,(int)AText);
- switch(pTVar6->Type) {
- case 1:
- puVar15 = &local_15c;
- for (iVar9 = 0x4b; iVar9 != 0; iVar9 = iVar9 + -1) {
- *puVar15 = 0;
- puVar15 = puVar15 + 1;
- }
- pcVar22 = GetDynamicString(pTVar6->Text);
- for (uVar19 = 0; sVar7 = strlen(pcVar22), uVar19 < sVar7; uVar19 = uVar19 + 1) {
- if (pcVar22[uVar19] == '%') {
- uVar19 = uVar19 + 1;
- cVar1 = pcVar22[uVar19];
- if (cVar1 == 'N') {
- strcpy((char *)&Minute,(this_00->super_TCreature).Name);
- }
- else if (cVar1 < 'O') {
- if (cVar1 == 'A') {
- iVar9 = npc->Amount;
-LAB_080b4856:
- sprintf((char *)&Minute,"%d",iVar9);
- }
- else {
-LAB_080b4814:
- Minute = Minute & 0xffffff00;
- }
- }
- else {
- if (cVar1 == 'P') {
- iVar9 = npc->Price;
- goto LAB_080b4856;
- }
- if (cVar1 != 'T') goto LAB_080b4814;
- GetTime(&local_1a4,&Hour);
- if (local_1a4 < 0xc) {
- pcVar23 = "%d:%.2d am";
- }
- else {
- pcVar23 = "%d:%.2d pm";
- }
- sprintf((char *)&Minute,pcVar23,(local_1a4 + 0xb) % 0xc + 1,Hour);
- }
- strcat((char *)&local_15c,(char *)&Minute);
- }
- else {
- puVar15 = &local_15c;
- do {
- puVar14 = puVar15;
- uVar16 = *puVar14 + 0xfefefeff & ~*puVar14;
- uVar17 = uVar16 & 0x80808080;
- puVar15 = puVar14 + 1;
- } while (uVar17 == 0);
- bVar20 = (uVar16 & 0x8080) == 0;
- if (bVar20) {
- uVar17 = uVar17 >> 0x10;
- }
- if (bVar20) {
- puVar15 = (uint *)((int)puVar14 + 6);
- }
- acStack_15f
- [(int)puVar15 +
- (-(int)&local_15c - (uint)CARRY1((byte)uVar17,(byte)uVar17))] =
- pcVar22[uVar19];
- }
- if (Response[0xfc] != '\0') goto LAB_080b4755;
- }
- if (Response[0xfc] == '\0') {
- TCreature::ToDoWait((TCreature *)npc,(int)B);
- TCreature::ToDoTalk((TCreature *)npc);
- puVar15 = &local_15c;
- do {
- puVar14 = puVar15;
- uVar17 = *puVar14 + 0xfefefeff & ~*puVar14;
- uVar19 = uVar17 & 0x80808080;
- puVar15 = puVar14 + 1;
- } while (uVar19 == 0);
- bVar21 = (uVar17 & 0x8080) == 0;
- if (bVar21) {
- uVar19 = uVar19 >> 0x10;
- }
- if (bVar21) {
- puVar15 = (uint *)((int)puVar14 + 6);
- }
- B = (TBehaviour *)
- ((int)&B[0x1c].Action +
- ((int)puVar15 +
- ((-3 - (uint)CARRY1((byte)uVar19,(byte)uVar19)) - (int)&local_15c) >> 1
- ) * 100 + 0x1c);
-LAB_080b49eb:
- bVar21 = true;
- }
- else {
-LAB_080b4755:
- Response[0x10] = '\0';
- puVar15 = &local_15c;
- pcVar22 =
- "TBehaviourDatabase::react: Text von NPC %s wird zu lang (%s...).\n";
-LAB_080b4779:
- error(pcVar22,(npc->super_TNonplayer).super_TCreature.Name,puVar15);
- }
- break;
- case 2:
- pTVar24 = npc;
- uVar8 = evaluate(this,npc,pTVar6->Expression,&local_2c);
- switch(pTVar6->Number) {
- default:
- pcVar22 = &DAT_08104dc0;
- goto LAB_080b4a67;
- case 1:
- npc->Topic = uVar8;
- break;
- case 2:
- npc->Price = uVar8;
- break;
- case 3:
- npc->Amount = uVar8;
- break;
- case 4:
- npc->TypeID = uVar8;
- break;
- case 6:
- npc->Data = uVar8;
- }
- break;
- case 3:
- pTVar24 = npc;
- iVar9 = evaluate(this,npc,pTVar6->Expression,&local_2c);
- if (pTVar6->Number != 2) {
- pcVar22 = &DAT_08104e00;
- goto LAB_080b4a67;
- }
- (*(this_00->super_TCreature).super_TSkillBase.Skills[2]->_vptr_TSkill[2])
- ((this_00->super_TCreature).super_TSkillBase.Skills[2],iVar9);
- iVar9 = TSkill::Get((this_00->super_TCreature).super_TSkillBase.Skills[2]);
- if (iVar9 < 1) {
- error(&DAT_08104e40,(npc->super_TNonplayer).super_TCreature.Name);
- (*(this_00->super_TCreature)._vptr_TCreature[2])(this_00);
- }
- break;
- case 4:
- iVar9 = evaluate(this,npc,pTVar6->Expression,&local_2c);
- pTVar24 = npc;
- iVar10 = evaluate(this,npc,pTVar6->Expression2,&local_2c);
- if (pTVar6->Number != 3) {
- pcVar22 = &DAT_08104e80;
- goto LAB_080b4a67;
- }
- TPlayer::SetQuestValue(this_00,iVar9,iVar10);
- break;
- case 5:
- pTVar24 = npc;
- iVar9 = evaluate(this,npc,pTVar6->Expression,&local_2c);
- switch(pTVar6->Number) {
- default:
- pcVar22 = &DAT_08104ec0;
- goto LAB_080b4a67;
- case 1:
- pTVar18 = (TPlayer *)npc;
- goto LAB_080b4bb8;
- case 2:
- pTVar18 = this_00;
-LAB_080b4bb8:
- Minute = (pTVar18->super_TCreature).CrObject.ObjectID;
- GraphicalEffect((Object *)&Minute,iVar9);
- break;
- case 3:
- TPlayer::SetProfession(this_00,(uchar)iVar9);
- break;
- case 4:
- TPlayer::LearnSpell(this_00,iVar9);
- break;
- case 5:
- Opp = (TPlayer *)(npc->super_TNonplayer).super_TCreature.posx;
- local_1ac = (npc->super_TNonplayer).super_TCreature.posy;
- local_1a8 = (npc->super_TNonplayer).super_TCreature.posz;
- if (iVar9 - 1U < 0x1ff) {
- if (RaceData[iVar9].Name[0] != '\0') {
- SearchFreeField((int *)&Opp,&local_1ac,&local_1a8,2,0,false);
- this_01 = (TMonster *)operator_new(0x32c);
- // try { // try from 080b4cfc to 080b4d00 has its CatchHandler @ 080b5666
- TMonster::TMonster(this_01);
- GraphicalEffect();
- break;
- }
- pcVar22 = &DAT_08104f00;
- }
- else {
- pcVar22 = &DAT_08104f40;
- }
- error(pcVar22,iVar9);
- break;
- case 6:
- Type = (ObjectType *)&Minute;
- ObjectType::setTypeID((ObjectType *)&Minute,iVar9);
- iVar9 = npc->Amount;
-LAB_080b4d73:
- TNPC::GiveTo(npc,Type,iVar9);
- break;
- case 7:
- ObjectType::setTypeID((ObjectType *)&Minute,iVar9);
- iVar9 = npc->Amount;
- if (iVar9 != 0) {
- pcVar22 = ObjectType::getName((ObjectType *)&Minute);
- Log("npc","%s <- %ld: %d %s\n",
- (npc->super_TNonplayer).super_TCreature.Name,npc->Interlocutor,iVar9
- ,pcVar22);
- // try { // try from 080b4e01 to 080b4e28 has its CatchHandler @ 080b5678
- ObjectType::setTypeID((ObjectType *)(Help + 0xc),Minute);
- DeleteAtCreature(npc->Interlocutor,(ObjectType *)(Help + 0xc),iVar9,
- npc->Data);
- }
- }
- break;
- case 6:
- iVar9 = pTVar6->Number;
- if (iVar9 != 2) {
- if (iVar9 < 3) {
- if (iVar9 == 1) {
- iVar10 = npc->Price;
- iVar9 = iVar10 % 100;
- Type = (ObjectType *)(Help + 0xc);
- GetSpecialObject((SPECIALMEANING)Type);
- TNPC::GiveTo(npc,Type,iVar10 / 10000);
- GetSpecialObject((SPECIALMEANING)Type);
- TNPC::GiveTo(npc,Type,(iVar10 % 10000) / 100);
- GetSpecialObject((SPECIALMEANING)Type);
- goto LAB_080b4d73;
- }
- }
- else if (iVar9 == 3) {
- if (Situation != BUSY) {
- error(&DAT_08104fc0);
- }
- TNPC::Enqueue(npc,npc->Interlocutor,Text);
- break;
- }
- pcVar22 = &DAT_08104f80;
- goto LAB_080b4a67;
- }
- TNPC::GetMoney(npc,npc->Price);
- break;
- case 7:
- if (!bVar21) {
- (npc->super_TNonplayer).State = pTVar6->Number;
- if (Situation == ADDRESSQUEUE) {
- pcVar22 =
- "TBehaviourDatabase::react: NPC %s reagiert nicht auf Anrede %s.\n";
- puVar15 = (uint *)Text;
- goto LAB_080b4779;
- }
- goto LAB_080b49eb;
- }
- iVar9 = pTVar6->Number;
- if (iVar9 == 1) {
- (npc->super_TNonplayer).State = LEAVING;
- iVar9 = pTVar6->Number;
- }
- TCreature::ToDoChangeState((TCreature *)npc,iVar9);
- break;
- case 8:
- iVar9 = evaluate(this,npc,pTVar6->Expression,&local_2c);
- pTVar24 = npc;
- evaluate(this,npc,pTVar6->Expression2,&local_2c);
- if (1 < pTVar6->Number - 0x11U) {
- pcVar22 = &DAT_08105080;
- goto LAB_080b4a67;
- }
- if ((iVar9 == 0) ||
- (pTVar2 = (this_00->super_TCreature).super_TSkillBase.Skills[pTVar6->Number],
- iVar10 = (*pTVar2->_vptr_TSkill[0xd])(pTVar2), iVar10 < iVar9)) {
- TSkillBase::SetTimer(&(this_00->super_TCreature).super_TSkillBase);
- if (pTVar6->Number == 0x12) {
- (this_00->super_TCreature).FireDamageOrigin = 0;
- }
- else {
- (this_00->super_TCreature).PoisonDamageOrigin = 0;
- }
- }
- break;
- case 9:
- if (i != 0) goto LAB_080b50d7;
- pcVar22 = "TBehaviourDatabase::react (9): Kein vorheriges Muster.\n";
-LAB_080b4a67:
- error(pcVar22,pTVar24);
- break;
- case 10:
- iVar9 = evaluate(this,npc,pTVar6->Expression,&local_2c);
- iVar10 = evaluate(this,npc,pTVar6->Expression2,&local_2c);
- pTVar24 = npc;
- iVar11 = evaluate(this,npc,pTVar6->Expression3,&local_2c);
- if (pTVar6->Number != 1) {
- if (pTVar6->Number == 2) {
- pTVar24 = (TNPC *)&DAT_08105140;
- print();
- if ((this_00->super_TCreature).Type == PLAYER) {
- (this_00->super_TCreature).startx = iVar9;
- (this_00->super_TCreature).startz = iVar11;
- (this_00->super_TCreature).starty = iVar10;
- TPlayer::SaveData(this_00);
- break;
- }
- pcVar22 = &DAT_08105180;
- }
- else {
- pcVar22 = &DAT_08105100;
- }
- goto LAB_080b4a67;
- }
- print();
- Help[0xc] = (undefined1)::NONE.ObjectID;
- Help[0xd] = ::NONE.ObjectID._1_1_;
- Help[0xe] = ::NONE.ObjectID._2_1_;
- Help[0xf] = ::NONE.ObjectID._3_1_;
- // try { // try from 080b5218 to 080b5265 has its CatchHandler @ 080b56be
- GetMapContainer((int)&Minute,iVar9,iVar10);
- Help._28_4_ = (this_00->super_TCreature).CrObject.ObjectID;
- Move(0,(Object *)(Help + 0x1c),(Object *)&Minute,-1,false,(Object *)(Help + 0xc)
- );
- }
- AText = AText + 1;
- if (pTVar5->Actions <= (int)AText) goto LAB_080b479b;
- } while( true );
- }
- pcVar22 = &DAT_08105280;
- }
- error(pcVar22);
- return;
-LAB_080b50d7:
- i = i + -1;
- goto LAB_080b4645;
-}
-
-
-
-void StartMonsterhomeTimer(int nr)
-
-{
- TMonsterhome *pTVar1;
- long lVar2;
- int NumberOfPlayers;
- TMonsterhome *MH;
- int PlayerAdjustedTime;
-
- if ((nr < 1) || (Monsterhomes < nr)) {
- error(&DAT_08105380,nr);
- }
- else {
- pTVar1 = vector<>::operator()(&Monsterhome,nr);
- if (0 < pTVar1->Timer) {
- error(&DAT_081053c0);
- return;
- }
- if (pTVar1->ActMonsters < pTVar1->MaxMonsters) {
- GetNumberOfPlayers();
- lVar2 = random();
- pTVar1->Timer = lVar2;
- }
- else {
- error("StartMonsterhomeTimer: Maximale Monsterzahl schon erreicht.\n");
- error("# Monsterhome mit Rasse %d an [%d,%d,%d]\n",pTVar1->Race,pTVar1->x,pTVar1->y,
- pTVar1->z);
- }
- }
- return;
-}
-
-
-
-// WARNING: Removing unreachable block (ram,0x080b5ba0)
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void LoadMonsterhomes(void)
-
-{
- bool bVar1;
- int r;
- int iVar2;
- TMonsterhome *pTVar3;
- TMonster *this;
- int *piVar4;
- int Race;
- TMonsterhome *MH;
- char *Text;
- char *pcVar5;
- int local_5024;
- int j;
- int i;
- int local_5018;
- int local_5014;
- int local_5010;
- int x;
- int y;
- int z;
- int local_5000;
- undefined1 local_4ffc [4];
- TReadScriptFile Script;
- char local_101c [4];
- char FileName [4096];
-
- // try { // try from 080b5821 to 080b5851 has its CatchHandler @ 080b5c40
- print();
- pcVar5 = DATAPATH;
- sprintf(local_101c,"%s/monster.db");
- TReadScriptFile::TReadScriptFile((TReadScriptFile *)local_4ffc);
- // try { // try from 080b5859 to 080b5955 has its CatchHandler @ 080b5c33
- TReadScriptFile::open((TReadScriptFile *)local_4ffc,local_101c,(int)pcVar5);
- Monsterhomes = 0;
- while (iVar2 = TReadScriptFile::readNumber((TReadScriptFile *)local_4ffc), iVar2 != 0) {
- Monsterhomes = Monsterhomes + 1;
- pTVar3 = vector<>::operator()(&Monsterhome,Monsterhomes);
- pTVar3->Race = iVar2;
- iVar2 = TReadScriptFile::readNumber((TReadScriptFile *)local_4ffc);
- pTVar3->x = iVar2;
- iVar2 = TReadScriptFile::readNumber((TReadScriptFile *)local_4ffc);
- pTVar3->y = iVar2;
- iVar2 = TReadScriptFile::readNumber((TReadScriptFile *)local_4ffc);
- pTVar3->z = iVar2;
- bVar1 = IsOnMap(pTVar3->x,pTVar3->y,iVar2);
- if (!bVar1) {
- print();
- }
- iVar2 = TReadScriptFile::readNumber((TReadScriptFile *)local_4ffc);
- pTVar3->Radius = iVar2;
- iVar2 = TReadScriptFile::readNumber((TReadScriptFile *)local_4ffc);
- pTVar3->MaxMonsters = iVar2;
- pTVar3->ActMonsters = 0;
- iVar2 = TReadScriptFile::readNumber((TReadScriptFile *)local_4ffc);
- pTVar3->RegenerationTime = iVar2;
- pTVar3->Timer = 0;
- }
- pcVar5 = "%d Monsterhomes geladen.\n";
- print();
- TReadScriptFile::close((TReadScriptFile *)local_4ffc,(int)pcVar5);
- j = 1;
- if (0 < Monsterhomes) {
- do {
- pcVar5 = (char *)j;
- // try { // try from 080b5994 to 080b5b4d has its CatchHandler @ 080b5c33
- pTVar3 = vector<>::operator()(&Monsterhome,j);
- local_5024 = 0;
- iVar2 = pTVar3->MaxMonsters;
- if (0 < iVar2) {
- do {
- local_5010 = pTVar3->x;
- x = pTVar3->y;
- y = pTVar3->z;
- if (local_5024 == 0) {
- local_5000 = 1;
- piVar4 = &local_5000;
- if (pTVar3->Radius < 1) {
- piVar4 = &pTVar3->Radius;
- }
- iVar2 = *piVar4;
- }
- else {
- z = 10;
- piVar4 = &z;
- if (pTVar3->Radius < 10) {
- piVar4 = &pTVar3->Radius;
- }
- iVar2 = -*piVar4;
- }
- pcVar5 = (char *)&x;
- bVar1 = SearchSpawnField(&local_5010,(int *)pcVar5,&y,iVar2,false);
- if (bVar1) {
- pcVar5 = (char *)pTVar3->Race;
- i = local_5010;
- local_5018 = x;
- local_5014 = y;
- if ((int)pcVar5 - 1U < 0x1ff) {
- if (RaceData[(int)pcVar5].Name[0] == '\0') {
- Text = &DAT_08104f00;
- goto LAB_080b5a8b;
- }
- SearchFreeField(&i,&local_5018,&local_5014,2,0,false);
- this = (TMonster *)operator_new(0x32c);
- // try { // try from 080b5b91 to 080b5b95 has its CatchHandler @ 080b5c04
- TMonster::TMonster(this);
- }
- else {
- Text = &DAT_08104f40;
-LAB_080b5a8b:
- error(Text);
- }
- pTVar3->ActMonsters = pTVar3->ActMonsters + 1;
- }
- local_5024 = local_5024 + 1;
- iVar2 = pTVar3->MaxMonsters;
- } while (local_5024 < iVar2);
- }
- if (pTVar3->Timer < 1) {
- if (pTVar3->ActMonsters < iVar2) {
- StartMonsterhomeTimer(j);
- }
- }
- else {
- pcVar5 = (char *)pTVar3->Race;
- error(&DAT_08105500,pcVar5,pTVar3->x,pTVar3->y,pTVar3->z);
- }
- j = j + 1;
- } while (j <= Monsterhomes);
- }
- // try { // try from 080b5971 to 080b5975 has its CatchHandler @ 080b5c40
- TReadScriptFile::~TReadScriptFile((TReadScriptFile *)local_4ffc,(int)pcVar5);
- return;
-}
-
-
-
-// WARNING: Removing unreachable block (ram,0x080b5f11)
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ProcessMonsterhomes(void)
-
-{
- bool bVar1;
- int r;
- TMonsterhome *pTVar2;
- int iVar3;
- int *piVar4;
- ulong id;
- TCreature *pTVar5;
- uint uVar6;
- TMonster *this;
- int iVar7;
- TCreature *cr;
- uint uVar8;
- TMonsterhome *MH;
- int i;
- int i_00;
- char *Text;
- int local_78;
- int local_74;
- int local_70;
- int local_6c;
- int x;
- int y;
- int z;
- int local_5c [3];
- int MaxRadius;
- undefined1 local_4c [4];
- TFindCreatures Search;
-
- i_00 = 1;
- if (0 < Monsterhomes) {
- do {
- pTVar2 = vector<>::operator()(&Monsterhome,i_00);
- if ((pTVar2->Timer != 0) &&
- (iVar3 = pTVar2->Timer + -1, pTVar2->Timer = iVar3, iVar3 < 1)) {
- local_6c = pTVar2->x;
- x = pTVar2->y;
- y = pTVar2->z;
- MaxRadius = 10;
- piVar4 = &MaxRadius;
- if (pTVar2->Radius < 10) {
- piVar4 = &pTVar2->Radius;
- }
- local_5c[2] = *piVar4;
- iVar3 = 1;
- TFindCreatures::TFindCreatures
- ((TFindCreatures *)local_4c,local_5c[2] + 9,local_5c[2] + 7,local_6c,x,1);
-LAB_080b5d00:
- while (id = TFindCreatures::getNext((TFindCreatures *)local_4c), id != 0) {
- pTVar5 = GetCreature(id);
- if (pTVar5 == (TCreature *)0x0) {
- error("ProcessMonsterhomes: Kreatur existiert nicht.\n");
- break;
- }
- if (pTVar5->posz < 8) goto LAB_080b5d8f;
- if ((y - pTVar5->posz) + 2U < 5) goto LAB_080b5d39;
- }
- if (pTVar2->ActMonsters == 0) {
- z = 1;
- piVar4 = &z;
- if (pTVar2->Radius < 1) {
- piVar4 = &pTVar2->Radius;
- }
- iVar7 = *piVar4;
- }
- else {
- iVar7 = -local_5c[2];
- }
- if ((-1 < local_5c[2]) &&
- (bVar1 = SearchSpawnField(&local_6c,&x,&y,iVar7,false), bVar1)) {
- iVar7 = pTVar2->Race;
- local_78 = local_6c;
- local_74 = x;
- local_70 = y;
- if (iVar7 - 1U < 0x1ff) {
- if (RaceData[iVar7].Name[0] == '\0') {
- Text = &DAT_08104f00;
- goto LAB_080b5e43;
- }
- SearchFreeField(&local_78,&local_74,&local_70,2,0,false);
- this = (TMonster *)operator_new(0x32c);
- iVar3 = i_00;
- // try { // try from 080b5f02 to 080b5f06 has its CatchHandler @ 080b5f53
- TMonster::TMonster(this);
- }
- else {
- Text = &DAT_08104f40;
-LAB_080b5e43:
- error(Text,iVar7);
- }
- pTVar2->ActMonsters = pTVar2->ActMonsters + 1;
- if (0 < pTVar2->Timer) {
- error(&DAT_08105580,pTVar2->Race,local_6c,x,y,iVar3);
- goto LAB_080b5c95;
- }
- }
- if (pTVar2->ActMonsters < pTVar2->MaxMonsters) {
- StartMonsterhomeTimer(i_00);
- }
- }
-LAB_080b5c95:
- i_00 = i_00 + 1;
- } while (i_00 <= Monsterhomes);
- }
- return;
-LAB_080b5d8f:
- if (y < 8) {
-LAB_080b5d39:
- uVar8 = pTVar5->posx - local_6c;
- if (0x7fffffff < uVar8) {
- uVar8 = -uVar8;
- }
- uVar6 = pTVar5->posy - x;
- local_5c[1] = uVar8 - 9;
- if (0x7fffffff < uVar6) {
- uVar6 = -uVar6;
- }
- local_5c[0] = uVar6 - 7;
- piVar4 = local_5c;
- if ((int)(uVar6 - 7) <= (int)(uVar8 - 9)) {
- piVar4 = local_5c + 1;
- }
- if (local_5c[2] <= *piVar4) {
- piVar4 = local_5c + 2;
- }
- local_5c[2] = *piVar4;
- }
- goto LAB_080b5d00;
-}
-
-
-
-void NotifyMonsterhomeOfDeath(int nr)
-
-{
- TMonsterhome *pTVar1;
- int iVar2;
- TMonsterhome *MH;
-
- if ((nr < 1) || (Monsterhomes < nr)) {
- error(&DAT_081055e0,nr);
- }
- else {
- pTVar1 = vector<>::operator()(&Monsterhome,nr);
- if (pTVar1->ActMonsters < 1) {
- error("NotifyMonsterhomeOfDeath: Monsterhome hat keine lebenden Kreaturen.\n");
- return;
- }
- iVar2 = pTVar1->ActMonsters + -1;
- pTVar1->ActMonsters = iVar2;
- if (iVar2 < pTVar1->MaxMonsters) {
- if (pTVar1->Timer == 0) {
- StartMonsterhomeTimer(nr);
- return;
- }
- }
- else {
- error("NotifyMonsterhomeOfDeath: Monsterhome %d hatte zu viele Monster (%d statt %d).\n"
- ,nr,pTVar1->ActMonsters + 1,pTVar1->MaxMonsters);
- }
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-bool MonsterhomeInRange(void)
-
-{
- TMonsterhome *pTVar1;
- uint uVar2;
- TMonsterhome *MH;
- bool bVar3;
- int in_stack_00000004;
- int in_stack_00000008;
- int in_stack_0000000c;
- int in_stack_00000010;
-
- bVar3 = true;
- if (in_stack_00000004 != 0) {
- if ((in_stack_00000004 < 1) || (Monsterhomes < in_stack_00000004)) {
- error(&DAT_081056e0);
- bVar3 = false;
- }
- else {
- pTVar1 = vector<>::operator()(&Monsterhome,in_stack_00000004);
- uVar2 = in_stack_00000010 - pTVar1->z;
- if (0x7fffffff < uVar2) {
- uVar2 = -uVar2;
- }
- bVar3 = false;
- if ((int)uVar2 < 3) {
- uVar2 = in_stack_00000008 - pTVar1->x;
- if (0x7fffffff < uVar2) {
- uVar2 = -uVar2;
- }
- bVar3 = false;
- if ((int)uVar2 <= pTVar1->Radius) {
- uVar2 = in_stack_0000000c - pTVar1->y;
- if (0x7fffffff < uVar2) {
- uVar2 = -uVar2;
- }
- bVar3 = (int)uVar2 <= pTVar1->Radius;
- }
- }
- }
- }
- return bVar3;
-}
-
-
-
-// DWARF original prototype: void TNonplayer(TNonplayer * this)
-
-void __thiscall TNonplayer::TNonplayer(TNonplayer *this)
-
-{
- TCreature::TCreature(&this->super_TCreature);
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TNonplayer_08127d28;
- this->State = SLEEPING;
- return;
-}
-
-
-
-// DWARF original prototype: void TNonplayer(TNonplayer * this)
-
-void __thiscall TNonplayer::TNonplayer(TNonplayer *this)
-
-{
- TCreature::TCreature(&this->super_TCreature);
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TNonplayer_08127d28;
- this->State = SLEEPING;
- return;
-}
-
-
-
-// DWARF original prototype: void ~TNonplayer(TNonplayer * this, int __in_chrg)
-
-void __thiscall TNonplayer::~TNonplayer(TNonplayer *this,int __in_chrg)
-
-{
- TNonplayer **ppTVar1;
- TNonplayer **ppTVar2;
- int i;
- int i_00;
- bool bVar3;
- int in_stack_ffffffe8;
-
- i_00 = 0;
- bVar3 = 0 < FirstFreeNonplayer;
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TNonplayer_08127d28;
- if (bVar3) {
- do {
- in_stack_ffffffe8 = i_00;
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- if (*ppTVar1 == this) {
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- ppTVar2 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer + -1);
- *ppTVar1 = *ppTVar2;
- in_stack_ffffffe8 = FirstFreeNonplayer + -1;
- ppTVar1 = vector<>::operator()(&NonplayerList,in_stack_ffffffe8);
- FirstFreeNonplayer = FirstFreeNonplayer + -1;
- *ppTVar1 = (TNonplayer *)0x0;
- goto LAB_080b6169;
- }
- i_00 = i_00 + 1;
- } while (i_00 < FirstFreeNonplayer);
- }
- error("TNonplayer::DelInList: Kreatur nicht gefunden.\n");
-LAB_080b6169:
- TCreature::~TCreature(&this->super_TCreature,in_stack_ffffffe8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TNonplayer(TNonplayer * this, int __in_chrg)
-
-void __thiscall TNonplayer::~TNonplayer(TNonplayer *this,int __in_chrg)
-
-{
- TNonplayer **ppTVar1;
- TNonplayer **ppTVar2;
- int i;
- int i_00;
- bool bVar3;
- int in_stack_ffffffe8;
-
- i_00 = 0;
- bVar3 = 0 < FirstFreeNonplayer;
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TNonplayer_08127d28;
- if (bVar3) {
- do {
- in_stack_ffffffe8 = i_00;
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- if (*ppTVar1 == this) {
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- ppTVar2 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer + -1);
- *ppTVar1 = *ppTVar2;
- in_stack_ffffffe8 = FirstFreeNonplayer + -1;
- ppTVar1 = vector<>::operator()(&NonplayerList,in_stack_ffffffe8);
- FirstFreeNonplayer = FirstFreeNonplayer + -1;
- *ppTVar1 = (TNonplayer *)0x0;
- goto LAB_080b6219;
- }
- i_00 = i_00 + 1;
- } while (i_00 < FirstFreeNonplayer);
- }
- error("TNonplayer::DelInList: Kreatur nicht gefunden.\n");
-LAB_080b6219:
- TCreature::~TCreature(&this->super_TCreature,in_stack_ffffffe8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TNonplayer(TNonplayer * this, int __in_chrg)
-
-void __thiscall TNonplayer::~TNonplayer(TNonplayer *this,int __in_chrg)
-
-{
- TNonplayer **ppTVar1;
- TNonplayer **ppTVar2;
- int i;
- int i_00;
- bool bVar3;
- int in_stack_ffffffe8;
-
- i_00 = 0;
- bVar3 = 0 < FirstFreeNonplayer;
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TNonplayer_08127d28;
- if (bVar3) {
- do {
- in_stack_ffffffe8 = i_00;
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- if (*ppTVar1 == this) {
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- ppTVar2 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer + -1);
- *ppTVar1 = *ppTVar2;
- in_stack_ffffffe8 = FirstFreeNonplayer + -1;
- ppTVar1 = vector<>::operator()(&NonplayerList,in_stack_ffffffe8);
- FirstFreeNonplayer = FirstFreeNonplayer + -1;
- *ppTVar1 = (TNonplayer *)0x0;
- goto LAB_080b62c9;
- }
- i_00 = i_00 + 1;
- } while (i_00 < FirstFreeNonplayer);
- }
- error("TNonplayer::DelInList: Kreatur nicht gefunden.\n");
-LAB_080b62c9:
- TCreature::~TCreature(&this->super_TCreature,in_stack_ffffffe8);
- operator_delete(this);
- return;
-}
-
-
-
-// DWARF original prototype: void SetInList(TNonplayer * this)
-
-void __thiscall TNonplayer::SetInList(TNonplayer *this)
-
-{
- TNonplayer **ppTVar1;
-
- TCreature::SetInCrList(&this->super_TCreature);
- ppTVar1 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer);
- *ppTVar1 = this;
- FirstFreeNonplayer = FirstFreeNonplayer + 1;
- return;
-}
-
-
-
-// DWARF original prototype: void DelInList(TNonplayer * this)
-
-void __thiscall TNonplayer::DelInList(TNonplayer *this)
-
-{
- TNonplayer **ppTVar1;
- TNonplayer **ppTVar2;
- int i;
- int i_00;
-
- i_00 = 0;
- if (0 < FirstFreeNonplayer) {
- do {
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- if (*ppTVar1 == this) {
- ppTVar1 = vector<>::operator()(&NonplayerList,i_00);
- ppTVar2 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer + -1);
- *ppTVar1 = *ppTVar2;
- ppTVar1 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer + -1);
- *ppTVar1 = (TNonplayer *)0x0;
- FirstFreeNonplayer = FirstFreeNonplayer + -1;
- return;
- }
- i_00 = i_00 + 1;
- } while (i_00 < FirstFreeNonplayer);
- }
- error("TNonplayer::DelInList: Kreatur nicht gefunden.\n");
- return;
-}
-
-
-
-// DWARF original prototype: void TNPC(TNPC * this, char * FileName)
-
-void __thiscall TNPC::TNPC(TNPC *this,char *FileName)
-
-{
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar1;
- bool bVar2;
- int GoStrength;
- char *pcVar3;
- TBehaviourDatabase *this_00;
- undefined4 *puVar4;
- TOutfit *this_01;
- TNonplayer **ppTVar5;
- int iVar6;
- TSkillBase *this_02;
- char *pcVar7;
- char *pcVar8;
- undefined1 uVar9;
- int *__oflag;
- int *piVar10;
- char local_401c [4];
- char Ident [30];
- TReadScriptFile Script;
-
- // try { // try from 080b643b to 080b643f has its CatchHandler @ 080b6ae0
- TCreature::TCreature((TCreature *)this);
- (this->super_TNonplayer).State = SLEEPING;
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TNPC_08127ce8;
- // try { // try from 080b6477 to 080b647b has its CatchHandler @ 080b6ad8
- vector<>::vector(&this->QueuedPlayers,0,9,10);
- piVar10 = (int *)0xa;
- // try { // try from 080b64a5 to 080b64a9 has its CatchHandler @ 080b6ad2
- vector<>::vector(&this->QueuedAddresses,0,9,10);
- __oflag = (int *)FileName;
- // try { // try from 080b64bd to 080b6560 has its CatchHandler @ 080b6acc
- print();
- (this->super_TNonplayer).super_TCreature.Type = NPC;
- (this->super_TNonplayer).super_TCreature.Sex = 1;
- (this->super_TNonplayer).super_TCreature.Race = 0;
- (this->super_TNonplayer).super_TCreature.Outfit.OutfitID = 0;
- (this->super_TNonplayer).super_TCreature.Outfit.field_1 =
- (anon_union_4_2_730cd3ca_for_TOutfit_2)0x0;
- (this->super_TNonplayer).super_TCreature.posz = 0xff;
- this->Behaviour = (TBehaviourDatabase *)0x0;
- this->Topic = 0;
- this->Amount = 1;
- this->Price = 0;
- this->TypeID = 0;
- this->Data = 0;
- (this->super_TNonplayer).super_TCreature.Name[0] = '\0';
- this->LastTalk = 0;
- this->QueueLength = 0;
- (this->super_TNonplayer).super_TCreature.Direction = 2;
- TReadScriptFile::TReadScriptFile((TReadScriptFile *)(Ident + 0x1c));
- // try { // try from 080b656e to 080b66f8 has its CatchHandler @ 080b6ac6
- TReadScriptFile::open((TReadScriptFile *)(Ident + 0x1c),FileName,(int)__oflag);
- while( true ) {
- TReadScriptFile::nextToken((TReadScriptFile *)(Ident + 0x1c));
- if (stack0xffffc004 == 0) break;
- uVar9 = stack0xffffc004 == 1;
- if (!(bool)uVar9) {
- TReadScriptFile::error((TReadScriptFile *)(Ident + 0x1c),"identifier expected");
- }
- pcVar3 = TReadScriptFile::getIdentifier((TReadScriptFile *)(Ident + 0x1c));
- strcpy(local_401c,pcVar3);
- FileName = (char *)0x3d;
- TReadScriptFile::readSymbol((TReadScriptFile *)(Ident + 0x1c),'=');
- iVar6 = 5;
- pcVar3 = local_401c;
- pcVar7 = "name";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- FileName = TReadScriptFile::readString((TReadScriptFile *)(Ident + 0x1c));
- pcVar3 = (this->super_TNonplayer).super_TCreature.Name;
- uVar9 = pcVar3 == (char *)0x0;
- strcpy(pcVar3,FileName);
- }
- iVar6 = 4;
- pcVar3 = local_401c;
- pcVar7 = "sex";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- pcVar3 = TReadScriptFile::readIdentifier((TReadScriptFile *)(Ident + 0x1c));
- (this->super_TNonplayer).super_TCreature.Sex = 0xff;
- iVar6 = 5;
- pcVar7 = pcVar3;
- pcVar8 = "male";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar7 == *pcVar8;
- pcVar7 = pcVar7 + 1;
- pcVar8 = pcVar8 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- (this->super_TNonplayer).super_TCreature.Sex = 1;
- }
- iVar6 = 7;
- pcVar7 = "female";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- (this->super_TNonplayer).super_TCreature.Sex = 2;
- }
- uVar9 = (this->super_TNonplayer).super_TCreature.Sex == 0xff;
- if ((bool)uVar9) {
- FileName = "unknown constant";
- TReadScriptFile::error((TReadScriptFile *)(Ident + 0x1c),"unknown constant");
- }
- }
- iVar6 = 5;
- pcVar3 = local_401c;
- pcVar7 = "race";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- FileName = (char *)TReadScriptFile::readNumber((TReadScriptFile *)(Ident + 0x1c));
- this_02 = &(this->super_TNonplayer).super_TCreature.super_TSkillBase;
- uVar9 = this_02 == (TSkillBase *)0x0;
- (this->super_TNonplayer).super_TCreature.Race = (int)FileName;
- TSkillBase::SetSkills(this_02,(int)FileName);
- }
- iVar6 = 7;
- pcVar3 = local_401c;
- pcVar7 = "outfit";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- FileName = Ident + 0x1c;
- this_01 = &(this->super_TNonplayer).super_TCreature.Outfit;
- uVar9 = this_01 == (TOutfit *)0x0;
- TOutfit::load(this_01,(TReadScriptFile *)FileName);
- }
- iVar6 = 5;
- pcVar3 = local_401c;
- pcVar7 = "home";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- TReadScriptFile::readCoordinate((TReadScriptFile *)(Ident + 0x1c));
- piVar10 = &(this->super_TNonplayer).super_TCreature.startz;
- __oflag = &(this->super_TNonplayer).super_TCreature.starty;
- FileName = (char *)&(this->super_TNonplayer).super_TCreature.startx;
- uVar9 = (int *)FileName == (int *)0x0;
- TReadScriptFile::getCoordinate((TReadScriptFile *)(Ident + 0x1c));
- }
- iVar6 = 7;
- pcVar3 = local_401c;
- pcVar7 = "radius";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- iVar6 = TReadScriptFile::readNumber((TReadScriptFile *)(Ident + 0x1c));
- (this->super_TNonplayer).super_TCreature.Radius = iVar6;
- }
- iVar6 = 0xb;
- pcVar3 = local_401c;
- pcVar7 = "gostrength";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- uVar9 = (this->super_TNonplayer).super_TCreature.Race == 0;
- if ((bool)uVar9) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4,FileName,__oflag,piVar10);
- *puVar4 = "gostrength before race in npc-script-file";
- goto LAB_080b6737;
- }
- iVar6 = TReadScriptFile::readNumber((TReadScriptFile *)(Ident + 0x1c));
- (this->super_TNonplayer).super_TCreature.super_TSkillBase.Skills[4]->Act = iVar6;
- (this->super_TNonplayer).super_TCreature.super_TSkillBase.Skills[4]->Max = iVar6;
- }
- iVar6 = 10;
- pcVar3 = local_401c;
- pcVar7 = "behaviour";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- if (this->Behaviour != (TBehaviourDatabase *)0x0) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4,FileName,__oflag,piVar10);
- *puVar4 = "behaviour database specified twice for NPC";
- goto LAB_080b6737;
- }
- this_00 = (TBehaviourDatabase *)operator_new(0x8c);
- FileName = Ident + 0x1c;
- // try { // try from 080b670c to 080b6710 has its CatchHandler @ 080b6a60
- TBehaviourDatabase::TBehaviourDatabase(this_00,(TReadScriptFile *)FileName);
- this->Behaviour = this_00;
- }
- }
- TReadScriptFile::close((TReadScriptFile *)(Ident + 0x1c),(int)FileName);
- if ((this->super_TNonplayer).super_TCreature.Name[0] == '\0') {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "no name specified for NPC";
-LAB_080b6737:
- // WARNING: Subroutine does not return
- // try { // try from 080b674a to 080b696e has its CatchHandler @ 080b6ac6
- __cxa_throw(puVar4,char_const*::typeinfo,0);
- }
- iVar6 = (this->super_TNonplayer).super_TCreature.posz;
- if (iVar6 == 0xff) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "no startpoint specified for NPC";
- goto LAB_080b6737;
- }
- if (this->Behaviour == (TBehaviourDatabase *)0x0) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "no behaviour database specified for NPC";
- goto LAB_080b6737;
- }
- bVar2 = IsOnMap((this->super_TNonplayer).super_TCreature.posx,
- (this->super_TNonplayer).super_TCreature.posy,iVar6);
- if (bVar2) {
- aVar1 = (this->super_TNonplayer).super_TCreature.Outfit.field_1;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.OutfitID =
- (this->super_TNonplayer).super_TCreature.Outfit.OutfitID;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.field_1 = aVar1;
- // try { // try from 080b69b0 to 080b6a0c has its CatchHandler @ 080b6ac6
- TCreature::SetID((TCreature *)this,0);
- TCreature::SetInCrList((TCreature *)this);
- pcVar3 = (char *)FirstFreeNonplayer;
- ppTVar5 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer);
- FirstFreeNonplayer = FirstFreeNonplayer + 1;
- *ppTVar5 = &this->super_TNonplayer;
- bVar2 = TCreature::SetOnMap((TCreature *)this);
- if (bVar2) {
- TCreature::ToDoYield((TCreature *)this);
- goto LAB_080b6978;
- }
- pcVar3 = "WARNUNG: Kann NPC \'%s\' nicht setzen.\n";
- }
- else {
- pcVar3 = &DAT_08105800;
- }
- print();
-LAB_080b6978:
- // try { // try from 080b6978 to 080b697c has its CatchHandler @ 080b6acc
- TReadScriptFile::~TReadScriptFile((TReadScriptFile *)(Ident + 0x1c),(int)pcVar3);
- return;
-}
-
-
-
-// DWARF original prototype: void TNPC(TNPC * this, char * FileName)
-
-void __thiscall TNPC::TNPC(TNPC *this,char *FileName)
-
-{
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar1;
- bool bVar2;
- int GoStrength;
- char *pcVar3;
- TBehaviourDatabase *this_00;
- undefined4 *puVar4;
- TOutfit *this_01;
- TNonplayer **ppTVar5;
- int iVar6;
- TSkillBase *this_02;
- char *pcVar7;
- char *pcVar8;
- undefined1 uVar9;
- int *__oflag;
- int *piVar10;
- char local_401c [4];
- char Ident [30];
- TReadScriptFile Script;
-
- // try { // try from 080b6b0b to 080b6b0f has its CatchHandler @ 080b71b0
- TCreature::TCreature((TCreature *)this);
- (this->super_TNonplayer).State = SLEEPING;
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TNPC_08127ce8;
- // try { // try from 080b6b47 to 080b6b4b has its CatchHandler @ 080b71a8
- vector<>::vector(&this->QueuedPlayers,0,9,10);
- piVar10 = (int *)0xa;
- // try { // try from 080b6b75 to 080b6b79 has its CatchHandler @ 080b71a2
- vector<>::vector(&this->QueuedAddresses,0,9,10);
- __oflag = (int *)FileName;
- // try { // try from 080b6b8d to 080b6c30 has its CatchHandler @ 080b719c
- print();
- (this->super_TNonplayer).super_TCreature.Type = NPC;
- (this->super_TNonplayer).super_TCreature.Sex = 1;
- (this->super_TNonplayer).super_TCreature.Outfit.OutfitID = 0;
- (this->super_TNonplayer).super_TCreature.Race = 0;
- (this->super_TNonplayer).super_TCreature.Outfit.field_1 =
- (anon_union_4_2_730cd3ca_for_TOutfit_2)0x0;
- (this->super_TNonplayer).super_TCreature.posz = 0xff;
- this->Topic = 0;
- this->Behaviour = (TBehaviourDatabase *)0x0;
- this->Amount = 1;
- this->Price = 0;
- this->TypeID = 0;
- this->Data = 0;
- (this->super_TNonplayer).super_TCreature.Name[0] = '\0';
- this->LastTalk = 0;
- this->QueueLength = 0;
- (this->super_TNonplayer).super_TCreature.Direction = 2;
- TReadScriptFile::TReadScriptFile((TReadScriptFile *)(Ident + 0x1c));
- // try { // try from 080b6c3e to 080b6dc8 has its CatchHandler @ 080b7196
- TReadScriptFile::open((TReadScriptFile *)(Ident + 0x1c),FileName,(int)__oflag);
- while( true ) {
- TReadScriptFile::nextToken((TReadScriptFile *)(Ident + 0x1c));
- if (stack0xffffc004 == 0) break;
- uVar9 = stack0xffffc004 == 1;
- if (!(bool)uVar9) {
- TReadScriptFile::error((TReadScriptFile *)(Ident + 0x1c),"identifier expected");
- }
- pcVar3 = TReadScriptFile::getIdentifier((TReadScriptFile *)(Ident + 0x1c));
- strcpy(local_401c,pcVar3);
- FileName = (char *)0x3d;
- TReadScriptFile::readSymbol((TReadScriptFile *)(Ident + 0x1c),'=');
- iVar6 = 5;
- pcVar3 = local_401c;
- pcVar7 = "name";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- FileName = TReadScriptFile::readString((TReadScriptFile *)(Ident + 0x1c));
- pcVar3 = (this->super_TNonplayer).super_TCreature.Name;
- uVar9 = pcVar3 == (char *)0x0;
- strcpy(pcVar3,FileName);
- }
- iVar6 = 4;
- pcVar3 = local_401c;
- pcVar7 = "sex";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- pcVar3 = TReadScriptFile::readIdentifier((TReadScriptFile *)(Ident + 0x1c));
- iVar6 = 5;
- (this->super_TNonplayer).super_TCreature.Sex = 0xff;
- pcVar7 = pcVar3;
- pcVar8 = "male";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar7 == *pcVar8;
- pcVar7 = pcVar7 + 1;
- pcVar8 = pcVar8 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- (this->super_TNonplayer).super_TCreature.Sex = 1;
- }
- iVar6 = 7;
- pcVar7 = "female";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- (this->super_TNonplayer).super_TCreature.Sex = 2;
- }
- uVar9 = (this->super_TNonplayer).super_TCreature.Sex == 0xff;
- if ((bool)uVar9) {
- FileName = "unknown constant";
- TReadScriptFile::error((TReadScriptFile *)(Ident + 0x1c),"unknown constant");
- }
- }
- iVar6 = 5;
- pcVar3 = local_401c;
- pcVar7 = "race";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- FileName = (char *)TReadScriptFile::readNumber((TReadScriptFile *)(Ident + 0x1c));
- this_02 = &(this->super_TNonplayer).super_TCreature.super_TSkillBase;
- uVar9 = this_02 == (TSkillBase *)0x0;
- (this->super_TNonplayer).super_TCreature.Race = (int)FileName;
- TSkillBase::SetSkills(this_02,(int)FileName);
- }
- iVar6 = 7;
- pcVar3 = local_401c;
- pcVar7 = "outfit";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- FileName = Ident + 0x1c;
- this_01 = &(this->super_TNonplayer).super_TCreature.Outfit;
- uVar9 = this_01 == (TOutfit *)0x0;
- TOutfit::load(this_01,(TReadScriptFile *)FileName);
- }
- iVar6 = 5;
- pcVar3 = local_401c;
- pcVar7 = "home";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- TReadScriptFile::readCoordinate((TReadScriptFile *)(Ident + 0x1c));
- piVar10 = &(this->super_TNonplayer).super_TCreature.startz;
- __oflag = &(this->super_TNonplayer).super_TCreature.starty;
- FileName = (char *)&(this->super_TNonplayer).super_TCreature.startx;
- uVar9 = (int *)FileName == (int *)0x0;
- TReadScriptFile::getCoordinate((TReadScriptFile *)(Ident + 0x1c));
- }
- iVar6 = 7;
- pcVar3 = local_401c;
- pcVar7 = "radius";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- iVar6 = TReadScriptFile::readNumber((TReadScriptFile *)(Ident + 0x1c));
- (this->super_TNonplayer).super_TCreature.Radius = iVar6;
- }
- iVar6 = 0xb;
- pcVar3 = local_401c;
- pcVar7 = "gostrength";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- uVar9 = (this->super_TNonplayer).super_TCreature.Race == 0;
- if ((bool)uVar9) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4,FileName,__oflag,piVar10);
- *puVar4 = "gostrength before race in npc-script-file";
- goto LAB_080b6e07;
- }
- iVar6 = TReadScriptFile::readNumber((TReadScriptFile *)(Ident + 0x1c));
- (this->super_TNonplayer).super_TCreature.super_TSkillBase.Skills[4]->Act = iVar6;
- (this->super_TNonplayer).super_TCreature.super_TSkillBase.Skills[4]->Max = iVar6;
- }
- iVar6 = 10;
- pcVar3 = local_401c;
- pcVar7 = "behaviour";
- do {
- if (iVar6 == 0) break;
- iVar6 = iVar6 + -1;
- uVar9 = *pcVar3 == *pcVar7;
- pcVar3 = pcVar3 + 1;
- pcVar7 = pcVar7 + 1;
- } while ((bool)uVar9);
- if ((bool)uVar9) {
- if (this->Behaviour != (TBehaviourDatabase *)0x0) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4,FileName,__oflag,piVar10);
- *puVar4 = "behaviour database specified twice for NPC";
- goto LAB_080b6e07;
- }
- this_00 = (TBehaviourDatabase *)operator_new(0x8c);
- FileName = Ident + 0x1c;
- // try { // try from 080b6ddc to 080b6de0 has its CatchHandler @ 080b7130
- TBehaviourDatabase::TBehaviourDatabase(this_00,(TReadScriptFile *)FileName);
- this->Behaviour = this_00;
- }
- }
- TReadScriptFile::close((TReadScriptFile *)(Ident + 0x1c),(int)FileName);
- if ((this->super_TNonplayer).super_TCreature.Name[0] == '\0') {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "no name specified for NPC";
-LAB_080b6e07:
- // WARNING: Subroutine does not return
- // try { // try from 080b6e1a to 080b703e has its CatchHandler @ 080b7196
- __cxa_throw(puVar4,char_const*::typeinfo,0);
- }
- iVar6 = (this->super_TNonplayer).super_TCreature.posz;
- if (iVar6 == 0xff) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "no startpoint specified for NPC";
- goto LAB_080b6e07;
- }
- if (this->Behaviour == (TBehaviourDatabase *)0x0) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "no behaviour database specified for NPC";
- goto LAB_080b6e07;
- }
- bVar2 = IsOnMap((this->super_TNonplayer).super_TCreature.posx,
- (this->super_TNonplayer).super_TCreature.posy,iVar6);
- if (bVar2) {
- aVar1 = (this->super_TNonplayer).super_TCreature.Outfit.field_1;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.OutfitID =
- (this->super_TNonplayer).super_TCreature.Outfit.OutfitID;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.field_1 = aVar1;
- // try { // try from 080b7080 to 080b70dc has its CatchHandler @ 080b7196
- TCreature::SetID((TCreature *)this,0);
- TCreature::SetInCrList((TCreature *)this);
- pcVar3 = (char *)FirstFreeNonplayer;
- ppTVar5 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer);
- FirstFreeNonplayer = FirstFreeNonplayer + 1;
- *ppTVar5 = &this->super_TNonplayer;
- bVar2 = TCreature::SetOnMap((TCreature *)this);
- if (bVar2) {
- TCreature::ToDoYield((TCreature *)this);
- goto LAB_080b7048;
- }
- pcVar3 = "WARNUNG: Kann NPC \'%s\' nicht setzen.\n";
- }
- else {
- pcVar3 = &DAT_08105800;
- }
- print();
-LAB_080b7048:
- // try { // try from 080b7048 to 080b704c has its CatchHandler @ 080b719c
- TReadScriptFile::~TReadScriptFile((TReadScriptFile *)(Ident + 0x1c),(int)pcVar3);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TNPC(TNPC * this, int __in_chrg)
-
-void __thiscall TNPC::~TNPC(TNPC *this,int __in_chrg)
-
-{
- TBehaviourDatabase *pTVar1;
- TBehaviour *pTVar2;
- ulong *puVar3;
- TBehaviour *pTVar4;
- int in_stack_ffffffe8;
-
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TNPC_08127ce8;
- pTVar1 = this->Behaviour;
- if (pTVar1 != (TBehaviourDatabase *)0x0) {
- pTVar4 = (pTVar1->Behaviour).entry;
- if (pTVar4 != (TBehaviour *)0x0) {
- pTVar4 = pTVar4 + pTVar4[-1].Actions;
- while (pTVar2 = (pTVar1->Behaviour).entry, pTVar2 != pTVar4) {
- pTVar4 = pTVar4 + -1;
- TBehaviour::~TBehaviour(pTVar4,in_stack_ffffffe8);
- }
- operator_delete__(&pTVar2[-1].Actions);
- }
- TBehaviour::~TBehaviour(&(pTVar1->Behaviour).init,in_stack_ffffffe8);
- operator_delete(pTVar1);
- }
- puVar3 = (this->QueuedAddresses).entry;
- if (puVar3 != (ulong *)0x0) {
- operator_delete__(puVar3);
- }
- puVar3 = (this->QueuedPlayers).entry;
- if (puVar3 != (ulong *)0x0) {
- operator_delete__(puVar3);
- }
- TNonplayer::~TNonplayer(&this->super_TNonplayer,in_stack_ffffffe8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TNPC(TNPC * this, int __in_chrg)
-
-void __thiscall TNPC::~TNPC(TNPC *this,int __in_chrg)
-
-{
- TBehaviourDatabase *pTVar1;
- TBehaviour *pTVar2;
- ulong *puVar3;
- TBehaviour *pTVar4;
- int in_stack_ffffffe8;
-
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TNPC_08127ce8;
- pTVar1 = this->Behaviour;
- if (pTVar1 != (TBehaviourDatabase *)0x0) {
- pTVar4 = (pTVar1->Behaviour).entry;
- if (pTVar4 != (TBehaviour *)0x0) {
- pTVar4 = pTVar4 + pTVar4[-1].Actions;
- while (pTVar2 = (pTVar1->Behaviour).entry, pTVar2 != pTVar4) {
- pTVar4 = pTVar4 + -1;
- TBehaviour::~TBehaviour(pTVar4,in_stack_ffffffe8);
- }
- operator_delete__(&pTVar2[-1].Actions);
- }
- TBehaviour::~TBehaviour(&(pTVar1->Behaviour).init,in_stack_ffffffe8);
- operator_delete(pTVar1);
- }
- puVar3 = (this->QueuedAddresses).entry;
- if (puVar3 != (ulong *)0x0) {
- operator_delete__(puVar3);
- }
- puVar3 = (this->QueuedPlayers).entry;
- if (puVar3 != (ulong *)0x0) {
- operator_delete__(puVar3);
- }
- TNonplayer::~TNonplayer(&this->super_TNonplayer,in_stack_ffffffe8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TNPC(TNPC * this, int __in_chrg)
-
-void __thiscall TNPC::~TNPC(TNPC *this,int __in_chrg)
-
-{
- TBehaviourDatabase *pTVar1;
- TBehaviour *pTVar2;
- ulong *puVar3;
- TBehaviour *pTVar4;
- int in_stack_ffffffe8;
-
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TNPC_08127ce8;
- pTVar1 = this->Behaviour;
- if (pTVar1 != (TBehaviourDatabase *)0x0) {
- pTVar4 = (pTVar1->Behaviour).entry;
- if (pTVar4 != (TBehaviour *)0x0) {
- pTVar4 = pTVar4 + pTVar4[-1].Actions;
- while (pTVar2 = (pTVar1->Behaviour).entry, pTVar2 != pTVar4) {
- pTVar4 = pTVar4 + -1;
- TBehaviour::~TBehaviour(pTVar4,in_stack_ffffffe8);
- }
- operator_delete__(&pTVar2[-1].Actions);
- }
- TBehaviour::~TBehaviour(&(pTVar1->Behaviour).init,in_stack_ffffffe8);
- operator_delete(pTVar1);
- }
- puVar3 = (this->QueuedAddresses).entry;
- if (puVar3 != (ulong *)0x0) {
- operator_delete__(puVar3);
- }
- puVar3 = (this->QueuedPlayers).entry;
- if (puVar3 != (ulong *)0x0) {
- operator_delete__(puVar3);
- }
- TNonplayer::~TNonplayer(&this->super_TNonplayer,in_stack_ffffffe8);
- operator_delete(this);
- return;
-}
-
-
-
-// DWARF original prototype: void TalkStimulus(TNPC * this, ulong Speaker, char * Text)
-
-void __thiscall TNPC::TalkStimulus(TNPC *this,ulong Speaker,char *Text)
-
-{
- ulong uVar1;
- uchar Dir;
- TCreature *Opp;
- TCreature *pTVar2;
- int iVar3;
- int dy;
- int iVar4;
- int iVar5;
- int iVar6;
-
- if (Speaker != (this->super_TNonplayer).super_TCreature.ID) {
- if (Text == (char *)0x0) {
- this = (TNPC *)&DAT_08105920;
-LAB_080b757a:
- error((char *)this);
- return;
- }
- if (((this->super_TNonplayer).State == TALKING) || (this->QueueLength != 0)) {
- uVar1 = this->Interlocutor;
- if (Speaker == uVar1) {
- this->LastTalk = RoundNr;
- TBehaviourDatabase::react(this->Behaviour,this,Text,DEFAULT);
- }
- else {
- this->Interlocutor = Speaker;
- TBehaviourDatabase::react(this->Behaviour,this,Text,BUSY);
- this->Interlocutor = uVar1;
- }
- }
- else {
- TCreature::ToDoClear((TCreature *)this);
- (this->super_TNonplayer).State = TALKING;
- uVar1 = RoundNr;
- this->Interlocutor = Speaker;
- this->LastTalk = uVar1;
- TBehaviourDatabase::react(this->Behaviour,this,Text,ADDRESS);
- if ((this->super_TNonplayer).State == TALKING) {
- pTVar2 = GetCreature(this->Interlocutor);
- if (pTVar2 != (TCreature *)0x0) {
- iVar5 = pTVar2->posx - (this->super_TNonplayer).super_TCreature.posx;
- iVar4 = pTVar2->posy - (this->super_TNonplayer).super_TCreature.posy;
- iVar3 = -iVar5;
- if (-1 < iVar5) {
- iVar3 = iVar5;
- }
- iVar6 = -iVar4;
- if (-1 < iVar4) {
- iVar6 = iVar4;
- }
- if (iVar3 < iVar6) {
- Dir = ((char)~(byte)((uint)iVar4 >> 0x18) >> 7) * -2;
- }
- else {
- Dir = (char)(iVar5 >> 0x1f) * -2 + '\x01';
- }
- TCreature::Rotate((TCreature *)this,Dir);
- return;
- }
- this = (TNPC *)&DAT_081058e0;
- goto LAB_080b757a;
- }
- }
- }
- return;
-}
-
-
-
-// DWARF original prototype: void IdleStimulus(TNPC * this)
-
-void __thiscall TNPC::IdleStimulus(TNPC *this)
-
-{
- vector<> *this_00;
- vector<> *this_01;
- uchar Dir;
- int dir;
- ulong *puVar1;
- TCreature *pTVar2;
- ulong uVar3;
- int iVar4;
- ulong *puVar5;
- char *Text;
- STATE SVar6;
- int dy;
- int destX;
- int iVar7;
- int destY;
- int iVar8;
- int Try;
- int iVar9;
- undefined1 local_4c [4];
- TFindCreatures Search;
-
- SVar6 = (this->super_TNonplayer).State;
- if (SVar6 == TALKING) {
- if (RoundNr <= this->LastTalk + 0x1e) {
- TCreature::ToDoWait((TCreature *)this,2000);
-LAB_080b7808:
- TCreature::ToDoStart((TCreature *)this);
- return;
- }
- TBehaviourDatabase::react(this->Behaviour,this,"",VANISH);
- (this->super_TNonplayer).State = IDLE;
- SVar6 = IDLE;
- }
- if (SVar6 == IDLE) {
- if (0 < this->QueueLength) {
- this_00 = &this->QueuedPlayers;
- this_01 = &this->QueuedAddresses;
- do {
- (this->super_TNonplayer).State = TALKING;
- TCreature::ToDoClear((TCreature *)this);
- puVar1 = vector<>::operator()(this_00,0);
- uVar3 = *puVar1;
- this->Interlocutor = uVar3;
- pTVar2 = GetCreature(uVar3);
- if (pTVar2 == (TCreature *)0x0) {
- error(&DAT_08105960);
- (this->super_TNonplayer).State = IDLE;
- }
- else {
- puVar1 = vector<>::operator()(this_01,0);
- Text = GetDynamicString(*puVar1);
- TBehaviourDatabase::react(this->Behaviour,this,Text,ADDRESSQUEUE);
- }
- puVar1 = vector<>::operator()(this_01,0);
- DeleteDynamicString(*puVar1);
- iVar9 = this->QueueLength;
- iVar7 = 1;
- if (1 < iVar9) {
- do {
- puVar1 = vector<>::operator()(this_00,iVar7 + -1);
- puVar5 = vector<>::operator()(this_00,iVar7);
- *puVar1 = *puVar5;
- puVar1 = vector<>::operator()(this_01,iVar7 + -1);
- iVar8 = iVar7 + 1;
- puVar5 = vector<>::operator()(this_01,iVar7);
- *puVar1 = *puVar5;
- iVar9 = this->QueueLength;
- iVar7 = iVar8;
- } while (iVar8 < iVar9);
- }
- SVar6 = (this->super_TNonplayer).State;
- this->QueueLength = iVar9 + -1;
- if (SVar6 == TALKING) {
- pTVar2 = GetCreature(this->Interlocutor);
- if (pTVar2 == (TCreature *)0x0) {
- error(&DAT_081058e0);
- }
- else {
- iVar8 = pTVar2->posx - (this->super_TNonplayer).super_TCreature.posx;
- iVar7 = pTVar2->posy - (this->super_TNonplayer).super_TCreature.posy;
- iVar9 = -iVar8;
- if (-1 < iVar8) {
- iVar9 = iVar8;
- }
- iVar4 = -iVar7;
- if (-1 < iVar7) {
- iVar4 = iVar7;
- }
- if (iVar9 < iVar4) {
- Dir = ((char)~(byte)((uint)iVar7 >> 0x18) >> 7) * -2;
- }
- else {
- Dir = (char)(iVar8 >> 0x1f) * -2 + '\x01';
- }
- TCreature::Rotate((TCreature *)this,Dir);
- }
- this->LastTalk = RoundNr;
- return;
- }
- } while (0 < iVar9 + -1);
- }
- if ((this->super_TNonplayer).super_TCreature.LockToDo == false) {
- TFindCreatures::TFindCreatures
- ((TFindCreatures *)local_4c,10,10,(this->super_TNonplayer).super_TCreature.ID,
- 1);
- iVar9 = 0;
- uVar3 = TFindCreatures::getNext((TFindCreatures *)local_4c);
- if (uVar3 == 0) {
- (this->super_TNonplayer).State = SLEEPING;
- }
- else {
- do {
- iVar9 = iVar9 + 1;
- iVar7 = (this->super_TNonplayer).super_TCreature.posx;
- iVar8 = (this->super_TNonplayer).super_TCreature.posy;
- if (10 < iVar9) {
- TCreature::ToDoWait((TCreature *)this,2000);
- goto LAB_080b7808;
- }
- iVar4 = rand();
- iVar4 = iVar4 % 4;
- if (iVar4 == 1) {
- iVar7 = iVar7 + 1;
- }
- else if (iVar4 < 2) {
- if (iVar4 == 0) {
- iVar7 = iVar7 + -1;
- }
- }
- else if (iVar4 == 2) {
- iVar8 = iVar8 + -1;
- }
- else if (iVar4 == 3) {
- iVar8 = iVar8 + 1;
- }
- iVar4 = (*(this->super_TNonplayer).super_TCreature._vptr_TCreature[3])
- (this,iVar7,iVar8,
- (this->super_TNonplayer).super_TCreature.posz,1,0);
- } while ((char)iVar4 == '\0');
- // try { // try from 080b77aa to 080b77cc has its CatchHandler @ 080b79ac
- TCreature::ToDoGo((TCreature *)this,iVar7,iVar8,
- (this->super_TNonplayer).super_TCreature.posz,true,0x7fffffff);
- TCreature::ToDoWait((TCreature *)this,2000);
- TCreature::ToDoStart((TCreature *)this);
- }
- }
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: this_local
-// DWARF original prototype: void CreatureMoveStimulus(TNPC * this, ulong CreatureID, int Type)
-
-void __thiscall TNPC::CreatureMoveStimulus(TNPC *this,ulong CreatureID,int Type)
-
-{
- uchar Dir;
- TCreature *Opp;
- vector<> *this_00;
- ulong *puVar1;
- TCreature *pTVar2;
- uint uVar3;
- ulong uVar4;
- TCreature *pTVar5;
- int iVar6;
- vector<> *this_01;
- ulong *puVar7;
- int dy;
- int iVar8;
- int dx;
- int iVar9;
- TCreature *cr;
- int j;
- int iVar10;
- int local_20;
- int i;
- int Type_local;
- ulong CreatureID_local;
- TNPC *this_local;
-
- if ((0 < this->QueueLength) && (local_20 = 0, 0 < this->QueueLength)) {
- this_00 = &this->QueuedPlayers;
- do {
- puVar1 = vector<>::operator()(this_00,local_20);
- if ((CreatureID == *puVar1) ||
- (CreatureID == (this->super_TNonplayer).super_TCreature.ID)) {
- puVar1 = vector<>::operator()(this_00,local_20);
- pTVar2 = GetCreature(*puVar1);
- if (Type != 0) {
- uVar3 = pTVar2->posx - (this->super_TNonplayer).super_TCreature.posx;
- if (0x7fffffff < uVar3) {
- uVar3 = -uVar3;
- }
- if ((int)uVar3 < 5) {
- uVar3 = pTVar2->posy - (this->super_TNonplayer).super_TCreature.posy;
- if (0x7fffffff < uVar3) {
- uVar3 = -uVar3;
- }
- if (((int)uVar3 < 4) &&
- (pTVar2->posz == (this->super_TNonplayer).super_TCreature.posz))
- goto LAB_080b7a5c;
- }
- }
- this_01 = &this->QueuedAddresses;
- puVar1 = vector<>::operator()(this_01,local_20);
- DeleteDynamicString(*puVar1);
- iVar6 = this->QueueLength;
- iVar8 = local_20 + 1;
- if (local_20 + 1 < iVar6) {
- do {
- puVar1 = vector<>::operator()(this_00,iVar8 + -1);
- puVar7 = vector<>::operator()(this_00,iVar8);
- *puVar1 = *puVar7;
- puVar1 = vector<>::operator()(this_01,iVar8 + -1);
- iVar9 = iVar8 + 1;
- puVar7 = vector<>::operator()(this_01,iVar8);
- *puVar1 = *puVar7;
- iVar6 = this->QueueLength;
- iVar8 = iVar9;
- } while (iVar9 < iVar6);
- }
- this->QueueLength = iVar6 + -1;
- local_20 = local_20 + -1;
- }
-LAB_080b7a5c:
- local_20 = local_20 + 1;
- } while (local_20 < this->QueueLength);
- }
- if ((this->super_TNonplayer).State - TALKING < 2) {
- if ((CreatureID == this->Interlocutor) ||
- (CreatureID == (this->super_TNonplayer).super_TCreature.ID)) {
- pTVar2 = GetCreature(this->Interlocutor);
- if (pTVar2 == (TCreature *)0x0) {
- error(&DAT_081059e0);
- (this->super_TNonplayer).State = IDLE;
- goto LAB_080b7ac2;
- }
- if (Type != 0) {
- pTVar5 = GetCreature(this->Interlocutor);
- if (pTVar5 == (TCreature *)0x0) {
- error(&DAT_081058e0);
- }
- else {
- iVar9 = pTVar5->posx - (this->super_TNonplayer).super_TCreature.posx;
- iVar8 = pTVar5->posy - (this->super_TNonplayer).super_TCreature.posy;
- iVar6 = -iVar9;
- if (-1 < iVar9) {
- iVar6 = iVar9;
- }
- iVar10 = -iVar8;
- if (-1 < iVar8) {
- iVar10 = iVar8;
- }
- if (iVar6 < iVar10) {
- Dir = ((char)~(byte)((uint)iVar8 >> 0x18) >> 7) * -2;
- }
- else {
- Dir = (char)(iVar9 >> 0x1f) * -2 + '\x01';
- }
- TCreature::Rotate((TCreature *)this,Dir);
- }
- }
- if ((this->super_TNonplayer).State != LEAVING) {
- if (Type != 0) {
- uVar3 = pTVar2->posx - (this->super_TNonplayer).super_TCreature.posx;
- if (0x7fffffff < uVar3) {
- uVar3 = -uVar3;
- }
- if ((int)uVar3 < 5) {
- uVar3 = pTVar2->posy - (this->super_TNonplayer).super_TCreature.posy;
- if (0x7fffffff < uVar3) {
- uVar3 = -uVar3;
- }
- if (((int)uVar3 < 4) &&
- (pTVar2->posz == (this->super_TNonplayer).super_TCreature.posz))
- goto LAB_080b7b9c;
- }
- }
- TBehaviourDatabase::react(this->Behaviour,this,"",VANISH);
- (this->super_TNonplayer).State = IDLE;
- TCreature::ToDoYield((TCreature *)this);
- }
- uVar4 = (this->super_TNonplayer).super_TCreature.ID;
- goto LAB_080b7b8e;
- }
- }
- else {
-LAB_080b7b9c:
- uVar4 = (this->super_TNonplayer).super_TCreature.ID;
-LAB_080b7b8e:
- if (CreatureID == uVar4) {
- return;
- }
- }
- if (((this->super_TNonplayer).State != SLEEPING) || (Type == 0)) {
- return;
- }
- (this->super_TNonplayer).State = IDLE;
-LAB_080b7ac2:
- TCreature::ToDoYield((TCreature *)this);
- return;
-}
-
-
-
-// DWARF original prototype: void DamageStimulus(TNPC * this, ulong param_1, int param_2, int
-// param_3)
-
-void __thiscall TNPC::DamageStimulus(TNPC *this,ulong param_1,int param_2,int param_3)
-
-{
- return;
-}
-
-
-
-// DWARF original prototype: bool MovePossible(TNPC * this, int x, int y, int z, bool param_4, bool
-// param_5)
-
-bool __thiscall TNPC::MovePossible(TNPC *this,int x,int y,int z,bool param_4,bool param_5)
-
-{
- int iVar1;
- bool bVar2;
- bool bVar3;
- uint uVar4;
-
- bVar3 = false;
- // try { // try from 080b7dbd to 080b7e8a has its CatchHandler @ 080b7ea0
- bVar2 = CoordinateFlag();
- if (bVar2) {
- bVar3 = CoordinateFlag();
- bVar3 = !bVar3;
- }
- if ((bVar3) && (bVar3 = CoordinateFlag(), !bVar3)) {
- uVar4 = x - (this->super_TNonplayer).super_TCreature.startx;
- if (0x7fffffff < uVar4) {
- uVar4 = -uVar4;
- }
- iVar1 = (this->super_TNonplayer).super_TCreature.Radius;
- if ((int)uVar4 <= iVar1) {
- uVar4 = y - (this->super_TNonplayer).super_TCreature.starty;
- if (0x7fffffff < uVar4) {
- uVar4 = -uVar4;
- }
- if (((int)uVar4 <= iVar1) && (z == (this->super_TNonplayer).super_TCreature.startz)) {
- bVar3 = IsHouse(x,y,z);
- return !bVar3;
- }
- }
- }
- return false;
-}
-
-
-
-// DWARF original prototype: void GiveTo(TNPC * this, ObjectType * Type, int Amount)
-
-void __thiscall TNPC::GiveTo(TNPC *this,ObjectType *Type,int Amount)
-
-{
- bool bVar1;
- char *pcVar2;
- RESULT r;
- int i;
- int *piVar3;
- int iVar4;
- int local_44 [2];
- ObjectType local_3c [4];
- ObjectType local_2c [7];
-
- if (Amount != 0) {
- bVar1 = false;
- ObjectType::setTypeID(local_2c,0);
- if ((Type->TypeID == local_2c[0].TypeID) ||
- (pcVar2 = ObjectType::getName(Type), pcVar2 == (char *)0x0)) {
- bVar1 = true;
- }
- if (bVar1) {
- error("TNPC::GiveTo: %s will Objekte vom Typ %d erschaffen.\n",
- (this->super_TNonplayer).super_TCreature.Name,Type->TypeID);
- }
- else {
- pcVar2 = ObjectType::getName(Type);
- Log("npc","%s -> %ld: %d %s\n",(this->super_TNonplayer).super_TCreature.Name,
- this->Interlocutor,Amount,pcVar2);
- // try { // try from 080b7f85 to 080b8057 has its CatchHandler @ 080b8083
- bVar1 = ObjectType::getFlag(Type,CUMULATIVE);
- if (bVar1) {
- for (; 0 < Amount; Amount = Amount - *piVar3) {
- local_44[1] = 100;
- ObjectType::setTypeID(local_3c,Type->TypeID);
- CreateAtCreature((ulong)local_2c,(ObjectType *)this->Interlocutor,
- (ulong)local_3c);
- local_44[0] = 100;
- piVar3 = local_44;
- if (Amount < 0x65) {
- piVar3 = &Amount;
- }
- }
- }
- else {
- iVar4 = 0;
- if (0 < Amount) {
- do {
- ObjectType::setTypeID(local_2c,Type->TypeID);
- CreateAtCreature((ulong)local_3c,(ObjectType *)this->Interlocutor,
- (ulong)local_2c);
- iVar4 = iVar4 + 1;
- } while (iVar4 < Amount);
- }
- }
- }
- }
- return;
-}
-
-
-
-// DWARF original prototype: void GetFrom(TNPC * this, ObjectType * Type, int Amount)
-
-void __thiscall TNPC::GetFrom(TNPC *this,ObjectType *Type,int Amount)
-
-{
- char *pcVar1;
- RESULT r;
- ObjectType local_2c [7];
-
- if (Amount != 0) {
- pcVar1 = ObjectType::getName(Type);
- Log("npc","%s <- %ld: %d %s\n",(this->super_TNonplayer).super_TCreature.Name,
- this->Interlocutor,Amount,pcVar1);
- // try { // try from 080b814f to 080b8176 has its CatchHandler @ 080b8180
- ObjectType::setTypeID(local_2c,Type->TypeID);
- DeleteAtCreature(this->Interlocutor,local_2c,Amount,this->Data);
- }
- return;
-}
-
-
-
-// DWARF original prototype: void GiveMoney(TNPC * this, int Amount)
-
-void __thiscall TNPC::GiveMoney(TNPC *this,int Amount)
-
-{
- int Crystal;
- int Platinum;
-
- GetSpecialObject((SPECIALMEANING)&Platinum);
- GiveTo(this,(ObjectType *)&Platinum,Amount / 10000);
- GetSpecialObject((SPECIALMEANING)&Platinum);
- GiveTo(this,(ObjectType *)&Platinum,(Amount % 10000) / 100);
- GetSpecialObject((SPECIALMEANING)&Platinum);
- GiveTo(this,(ObjectType *)&Platinum,Amount % 100);
- return;
-}
-
-
-
-// DWARF original prototype: void GetMoney(TNPC * this, int Amount)
-
-void __thiscall TNPC::GetMoney(TNPC *this,int Amount)
-
-{
- int local_28;
- int Gold;
- int Platinum;
- int Crystal;
-
- GetSpecialObject((SPECIALMEANING)&Crystal);
- Platinum = CountInventoryObjects(this->Interlocutor,(ObjectType *)&Crystal,0);
- GetSpecialObject((SPECIALMEANING)&Crystal);
- Gold = CountInventoryObjects(this->Interlocutor,(ObjectType *)&Crystal,0);
- GetSpecialObject((SPECIALMEANING)&Crystal);
- local_28 = CountInventoryObjects(this->Interlocutor,(ObjectType *)&Crystal,0);
- CalculateChange(Amount,&local_28,&Gold,&Platinum);
- if (0 < local_28) {
- GetSpecialObject((SPECIALMEANING)&Crystal);
- GetFrom(this,(ObjectType *)&Crystal,local_28);
- }
- if (0 < Gold) {
- GetSpecialObject((SPECIALMEANING)&Crystal);
- GetFrom(this,(ObjectType *)&Crystal,Gold);
- }
- if (0 < Platinum) {
- GetSpecialObject((SPECIALMEANING)&Crystal);
- GetFrom(this,(ObjectType *)&Crystal,Platinum);
- }
- if (local_28 < 0) {
- GetSpecialObject((SPECIALMEANING)&Crystal);
- GiveTo(this,(ObjectType *)&Crystal,-local_28);
- }
- if (Gold < 0) {
- GetSpecialObject((SPECIALMEANING)&Crystal);
- GiveTo(this,(ObjectType *)&Crystal,-Gold);
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Interlocutor_local
-// DWARF original prototype: void Enqueue(TNPC * this, ulong Interlocutor, char * Text)
-
-void __thiscall TNPC::Enqueue(TNPC *this,ulong Interlocutor,char *Text)
-
-{
- ulong *puVar1;
- int i_00;
- ulong uVar2;
- int i;
- int i_01;
- char *Text_local;
- ulong Interlocutor_local;
-
- if (Interlocutor == 0) {
- this = (TNPC *)&DAT_08105ac0;
- }
- else {
- if (Text != (char *)0x0) {
- i_00 = this->QueueLength;
- i_01 = 0;
- if (0 < i_00) {
- do {
- puVar1 = vector<>::operator()(&this->QueuedPlayers,i_01);
- if (*puVar1 == Interlocutor) {
- return;
- }
- i_00 = this->QueueLength;
- i_01 = i_01 + 1;
- } while (i_01 < i_00);
- }
- puVar1 = vector<>::operator()(&this->QueuedPlayers,i_00);
- *puVar1 = Interlocutor;
- uVar2 = AddDynamicString(Text);
- puVar1 = vector<>::operator()(&this->QueuedAddresses,this->QueueLength);
- *puVar1 = uVar2;
- this->QueueLength = this->QueueLength + 1;
- return;
- }
- this = (TNPC *)s_TNPC__Enqueue__Text_ist_NULL__08105aa0;
- }
- error((char *)this);
- return;
-}
-
-
-
-// DWARF original prototype: void TurnToInterlocutor(TNPC * this)
-
-void __thiscall TNPC::TurnToInterlocutor(TNPC *this)
-
-{
- uchar Dir;
- TCreature *Opp;
- TCreature *pTVar1;
- int iVar2;
- int dy;
- int iVar3;
- int iVar4;
- int dx;
- int iVar5;
-
- pTVar1 = GetCreature(this->Interlocutor);
- if (pTVar1 != (TCreature *)0x0) {
- iVar5 = pTVar1->posx - (this->super_TNonplayer).super_TCreature.posx;
- iVar3 = pTVar1->posy - (this->super_TNonplayer).super_TCreature.posy;
- iVar4 = -iVar5;
- if (-1 < iVar5) {
- iVar4 = iVar5;
- }
- iVar2 = -iVar3;
- if (-1 < iVar3) {
- iVar2 = iVar3;
- }
- if (iVar4 < iVar2) {
- Dir = ((char)~(byte)((uint)iVar3 >> 0x18) >> 7) * -2;
- }
- else {
- Dir = (char)(iVar5 >> 0x1f) * -2 + '\x01';
- }
- TCreature::Rotate((TCreature *)this,Dir);
- return;
- }
- error(&DAT_081058e0);
- return;
-}
-
-
-
-// DWARF original prototype: void ChangeState(TNPC * this, STATE NewState, bool Stimulus)
-
-void __thiscall TNPC::ChangeState(TNPC *this,STATE NewState,bool Stimulus)
-
-{
- (this->super_TNonplayer).State = NewState;
- if (!Stimulus) {
- return;
- }
- TCreature::ToDoYield((TCreature *)this);
- return;
-}
-
-
-
-void ChangeNPCState(TCreature *npc,int NewState,bool Stimulus)
-
-{
- if (npc == (TCreature *)0x0) {
- npc = (TCreature *)s_ChangeNPCState__npc_ist_NULL__08105b40;
- }
- else {
- if (npc->Type == NPC) {
- npc[1]._vptr_TCreature = (_func_int_varargs **)NewState;
- if (!Stimulus) {
- return;
- }
- TCreature::ToDoYield(npc);
- return;
- }
- npc = (TCreature *)s_ChangeNPCState__npc_ist_kein_NPC_08105b00;
- }
- error((char *)npc);
- return;
-}
-
-
-
-// DWARF original prototype: void TMonster(TMonster * this, int Race, int x, int y, int z, int Home,
-// ulong Father)
-
-void __thiscall TMonster::TMonster(TMonster *this)
-
-{
- int iVar1;
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar2;
- bool bVar3;
- TCreature *pTVar4;
- TNonplayer **ppTVar5;
- TItemData *this_00;
- long lVar6;
- long lVar7;
- TCombat *this_01;
- int in_stack_00000008;
- int in_stack_0000000c;
- int in_stack_00000010;
- int in_stack_00000014;
- int in_stack_00000018;
- ulong in_stack_0000001c;
- char *Text;
- Object *this_02;
- int local_88;
- int j;
- int Repeat;
- int i;
- Object local_6c [4];
- Object local_5c [4];
- Object local_4c;
- Object Obj;
- ulong local_3c [4];
- Object local_2c;
- Object Bag;
-
- TCreature::TCreature((TCreature *)this);
- (this->super_TNonplayer).super_TCreature.Type = MONSTER;
- (this->super_TNonplayer).State = IDLE;
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TMonster_08127ca8;
- (this->super_TNonplayer).super_TCreature.Race = in_stack_00000008;
- (this->super_TNonplayer).super_TCreature.startx = in_stack_0000000c;
- (this->super_TNonplayer).super_TCreature.posx = in_stack_0000000c;
- this->Home = in_stack_00000018;
- (this->super_TNonplayer).super_TCreature.starty = in_stack_00000010;
- (this->super_TNonplayer).super_TCreature.posy = in_stack_00000010;
- (this->super_TNonplayer).super_TCreature.startz = in_stack_00000014;
- (this->super_TNonplayer).super_TCreature.posz = in_stack_00000014;
- this->Target = 0;
- this->Master = in_stack_0000001c;
- do {
- if (this->Master == 0) {
-LAB_080b873a:
- if (RaceData[in_stack_00000008].Article[0] == '\0') {
- strcpy((this->super_TNonplayer).super_TCreature.Name,
- RaceData[in_stack_00000008].Name);
- }
- else {
- snprintf((this->super_TNonplayer).super_TCreature.Name,0x1e,"%s %s",
- in_stack_00000008 * 0x150 + 0x81c477e,RaceData + in_stack_00000008);
- }
- TSkillBase::SetSkills
- (&(this->super_TNonplayer).super_TCreature.super_TSkillBase,in_stack_00000008)
- ;
- iVar1 = RaceData[in_stack_00000008].Outfit.OutfitID;
- aVar2 = RaceData[in_stack_00000008].Outfit.field_1;
- (this->super_TNonplayer).super_TCreature.Outfit.OutfitID = iVar1;
- (this->super_TNonplayer).super_TCreature.Outfit.field_1 = aVar2;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.OutfitID = iVar1;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.field_1 = aVar2;
- TCreature::SetID((TCreature *)this,0);
- TCreature::SetInCrList((TCreature *)this);
- ppTVar5 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer);
- FirstFreeNonplayer = FirstFreeNonplayer + 1;
- *ppTVar5 = &this->super_TNonplayer;
- bVar3 = TCreature::SetOnMap((TCreature *)this);
- if (bVar3) {
- if ((this->Master == 0) && (0 < RaceData[in_stack_00000008].Items)) {
- // try { // try from 080b8836 to 080b8904 has its CatchHandler @ 080b8c3e
- GetSpecialObject((SPECIALMEANING)local_3c);
- GetBodyContainer((ulong)&local_4c,(this->super_TNonplayer).super_TCreature.ID);
- Create(&local_2c,(ObjectType *)&local_4c,(ulong)local_3c);
- Repeat = 1;
- if (0 < RaceData[in_stack_00000008].Items) {
- do {
- this_00 = vector<TItemData>::operator()
- (&RaceData[in_stack_00000008].Item,Repeat);
- lVar6 = random();
- if (lVar6 <= this_00->Probability) {
- lVar7 = random();
- j = 1;
- bVar3 = ObjectType::getFlag(&this_00->Type,CUMULATIVE);
- lVar6 = lVar7;
- if (!bVar3) {
- lVar6 = 0;
- j = lVar7;
- }
- local_88 = 0;
- if (0 < j) {
- do {
- local_4c.ObjectID = 0;
- bVar3 = ObjectType::getFlag(&this_00->Type,WEAPON);
- if (((((bVar3) ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,SHIELD),
- bVar3)) ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,BOW), bVar3
- )) || ((bVar3 = ObjectType::getFlag(&this_00->Type,
- THROW), bVar3 ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,WAND
- ), bVar3)))) ||
- ((bVar3 = ObjectType::getFlag(&this_00->Type,WEAROUT),
- bVar3 || ((bVar3 = ObjectType::getFlag(&this_00->Type,
- EXPIRE), bVar3 ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,
- EXPIRESTOP),
- bVar3)))))) {
- // try { // try from 080b8a02 to 080b8a2d has its CatchHandler @ 080b8bd5
- ObjectType::setTypeID
- ((ObjectType *)local_6c,(this_00->Type).TypeID
- );
- lVar7 = 0;
- this_02 = local_6c;
- i = local_2c.ObjectID;
- Create(local_5c,(ObjectType *)&i,(ulong)this_02);
- local_4c.ObjectID = local_5c[0].ObjectID;
- local_3c[0] = local_5c[0].ObjectID;
- }
- else {
- this_02 = local_5c;
- ObjectType::setTypeID
- ((ObjectType *)this_02,(this_00->Type).TypeID)
- ;
- lVar7 = lVar6;
- CreateAtCreature((ulong)local_6c,
- (ObjectType *)
- (this->super_TNonplayer).
- super_TCreature.ID,(ulong)this_02);
- i = local_6c[0].ObjectID;
- local_4c.ObjectID = i;
- }
- // try { // try from 080b8a44 to 080b8b6d has its CatchHandler @ 080b8c3e
- Object::getContainer((Object *)&i);
- Object::getObjectType(local_6c);
- if (local_6c[0].ObjectID == 0) {
- error(&DAT_08105bc0,in_stack_00000008,this_02,lVar7);
- local_6c[0].ObjectID = local_4c.ObjectID;
- Delete(local_6c,-1);
- }
- local_88 = local_88 + 1;
- } while (local_88 < j);
- }
- }
- Repeat = Repeat + 1;
- } while (Repeat <= RaceData[in_stack_00000008].Items);
- }
- local_6c[0].ObjectID = local_2c.ObjectID;
- GetFirstContainerObject((Object *)&i);
- local_5c[0].ObjectID = ::NONE.ObjectID;
- if (i == ::NONE.ObjectID) {
- local_4c.ObjectID = local_2c.ObjectID;
- // try { // try from 080b8970 to 080b89ed has its CatchHandler @ 080b8c3e
- Delete(&local_4c,-1);
- }
- }
- this_01 = &(this->super_TNonplayer).super_TCreature.Combat;
- // try { // try from 080b8921 to 080b8953 has its CatchHandler @ 080b8c50
- TCombat::CheckCombatValues(this_01);
- TCombat::SetAttackMode(this_01,'\x02');
- TCreature::ToDoWait((TCreature *)this,0);
- TCreature::ToDoStart((TCreature *)this);
- }
- else {
- Text = "TMonster::TMonster: Kann Monster nicht auf die Karte setzen.\n";
-LAB_080b8b89:
- // try { // try from 080b8b89 to 080b8b8d has its CatchHandler @ 080b8c50
- error(Text);
- }
- return;
- }
- // try { // try from 080b86e6 to 080b87f7 has its CatchHandler @ 080b8c50
- pTVar4 = GetCreature(this->Master);
- if (pTVar4 == (TCreature *)0x0) {
- Text = "TMonster::TMonster: Master existiert nicht.\n";
- goto LAB_080b8b89;
- }
- if ((pTVar4->Type != MONSTER) || (pTVar4[1].super_TSkillBase.Skills[1] == (TSkill *)0x0)) {
- pTVar4->SummonedCreatures = pTVar4->SummonedCreatures + 1;
- (this->super_TNonplayer).super_TCreature.LifeEndRound = pTVar4->LifeEndRound;
- goto LAB_080b873a;
- }
- error(&DAT_08105b60);
- this->Master = (ulong)pTVar4[1].super_TSkillBase.Skills[1];
- } while( true );
-}
-
-
-
-// DWARF original prototype: void TMonster(TMonster * this, int Race, int x, int y, int z, int Home,
-// ulong Father)
-
-void __thiscall TMonster::TMonster(TMonster *this)
-
-{
- int iVar1;
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar2;
- bool bVar3;
- TCreature *pTVar4;
- TNonplayer **ppTVar5;
- TItemData *this_00;
- long lVar6;
- long lVar7;
- TCombat *this_01;
- int in_stack_00000008;
- int in_stack_0000000c;
- int in_stack_00000010;
- int in_stack_00000014;
- int in_stack_00000018;
- ulong in_stack_0000001c;
- char *Text;
- Object *this_02;
- int local_88;
- int j;
- int Repeat;
- int i;
- Object local_6c [4];
- Object local_5c [4];
- Object local_4c;
- Object Obj;
- ulong local_3c [4];
- Object local_2c;
- Object Bag;
-
- TCreature::TCreature((TCreature *)this);
- (this->super_TNonplayer).super_TCreature.Type = MONSTER;
- (this->super_TNonplayer).State = IDLE;
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TMonster_08127ca8;
- (this->super_TNonplayer).super_TCreature.Race = in_stack_00000008;
- (this->super_TNonplayer).super_TCreature.startx = in_stack_0000000c;
- (this->super_TNonplayer).super_TCreature.posx = in_stack_0000000c;
- this->Home = in_stack_00000018;
- (this->super_TNonplayer).super_TCreature.starty = in_stack_00000010;
- (this->super_TNonplayer).super_TCreature.posy = in_stack_00000010;
- (this->super_TNonplayer).super_TCreature.startz = in_stack_00000014;
- (this->super_TNonplayer).super_TCreature.posz = in_stack_00000014;
- this->Target = 0;
- this->Master = in_stack_0000001c;
- do {
- if (this->Master == 0) {
-LAB_080b8d5a:
- if (RaceData[in_stack_00000008].Article[0] == '\0') {
- strcpy((this->super_TNonplayer).super_TCreature.Name,
- RaceData[in_stack_00000008].Name);
- }
- else {
- snprintf((this->super_TNonplayer).super_TCreature.Name,0x1e,"%s %s",
- in_stack_00000008 * 0x150 + 0x81c477e,RaceData + in_stack_00000008);
- }
- TSkillBase::SetSkills
- (&(this->super_TNonplayer).super_TCreature.super_TSkillBase,in_stack_00000008)
- ;
- iVar1 = RaceData[in_stack_00000008].Outfit.OutfitID;
- aVar2 = RaceData[in_stack_00000008].Outfit.field_1;
- (this->super_TNonplayer).super_TCreature.Outfit.OutfitID = iVar1;
- (this->super_TNonplayer).super_TCreature.Outfit.field_1 = aVar2;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.OutfitID = iVar1;
- (this->super_TNonplayer).super_TCreature.OrgOutfit.field_1 = aVar2;
- TCreature::SetID((TCreature *)this,0);
- TCreature::SetInCrList((TCreature *)this);
- ppTVar5 = vector<>::operator()(&NonplayerList,FirstFreeNonplayer);
- FirstFreeNonplayer = FirstFreeNonplayer + 1;
- *ppTVar5 = &this->super_TNonplayer;
- bVar3 = TCreature::SetOnMap((TCreature *)this);
- if (bVar3) {
- if ((this->Master == 0) && (0 < RaceData[in_stack_00000008].Items)) {
- // try { // try from 080b8e56 to 080b8f24 has its CatchHandler @ 080b925e
- GetSpecialObject((SPECIALMEANING)local_3c);
- GetBodyContainer((ulong)&local_4c,(this->super_TNonplayer).super_TCreature.ID);
- Create(&local_2c,(ObjectType *)&local_4c,(ulong)local_3c);
- Repeat = 1;
- if (0 < RaceData[in_stack_00000008].Items) {
- do {
- this_00 = vector<TItemData>::operator()
- (&RaceData[in_stack_00000008].Item,Repeat);
- lVar6 = random();
- if (lVar6 <= this_00->Probability) {
- lVar7 = random();
- j = 1;
- bVar3 = ObjectType::getFlag(&this_00->Type,CUMULATIVE);
- lVar6 = lVar7;
- if (!bVar3) {
- lVar6 = 0;
- j = lVar7;
- }
- local_88 = 0;
- if (0 < j) {
- do {
- local_4c.ObjectID = 0;
- bVar3 = ObjectType::getFlag(&this_00->Type,WEAPON);
- if (((((bVar3) ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,SHIELD),
- bVar3)) ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,BOW), bVar3
- )) || ((bVar3 = ObjectType::getFlag(&this_00->Type,
- THROW), bVar3 ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,WAND
- ), bVar3)))) ||
- ((bVar3 = ObjectType::getFlag(&this_00->Type,WEAROUT),
- bVar3 || ((bVar3 = ObjectType::getFlag(&this_00->Type,
- EXPIRE), bVar3 ||
- (bVar3 = ObjectType::getFlag(&this_00->Type,
- EXPIRESTOP),
- bVar3)))))) {
- // try { // try from 080b9022 to 080b904d has its CatchHandler @ 080b91f5
- ObjectType::setTypeID
- ((ObjectType *)local_6c,(this_00->Type).TypeID
- );
- lVar7 = 0;
- this_02 = local_6c;
- i = local_2c.ObjectID;
- Create(local_5c,(ObjectType *)&i,(ulong)this_02);
- local_4c.ObjectID = local_5c[0].ObjectID;
- local_3c[0] = local_5c[0].ObjectID;
- }
- else {
- this_02 = local_5c;
- ObjectType::setTypeID
- ((ObjectType *)this_02,(this_00->Type).TypeID)
- ;
- lVar7 = lVar6;
- CreateAtCreature((ulong)local_6c,
- (ObjectType *)
- (this->super_TNonplayer).
- super_TCreature.ID,(ulong)this_02);
- i = local_6c[0].ObjectID;
- local_4c.ObjectID = i;
- }
- // try { // try from 080b9064 to 080b918d has its CatchHandler @ 080b925e
- Object::getContainer((Object *)&i);
- Object::getObjectType(local_6c);
- if (local_6c[0].ObjectID == 0) {
- error(&DAT_08105bc0,in_stack_00000008,this_02,lVar7);
- local_6c[0].ObjectID = local_4c.ObjectID;
- Delete(local_6c,-1);
- }
- local_88 = local_88 + 1;
- } while (local_88 < j);
- }
- }
- Repeat = Repeat + 1;
- } while (Repeat <= RaceData[in_stack_00000008].Items);
- }
- local_6c[0].ObjectID = local_2c.ObjectID;
- GetFirstContainerObject((Object *)&i);
- local_5c[0].ObjectID = ::NONE.ObjectID;
- if (i == ::NONE.ObjectID) {
- local_4c.ObjectID = local_2c.ObjectID;
- // try { // try from 080b8f90 to 080b900d has its CatchHandler @ 080b925e
- Delete(&local_4c,-1);
- }
- }
- this_01 = &(this->super_TNonplayer).super_TCreature.Combat;
- // try { // try from 080b8f41 to 080b8f73 has its CatchHandler @ 080b9270
- TCombat::CheckCombatValues(this_01);
- TCombat::SetAttackMode(this_01,'\x02');
- TCreature::ToDoWait((TCreature *)this,0);
- TCreature::ToDoStart((TCreature *)this);
- }
- else {
- Text = "TMonster::TMonster: Kann Monster nicht auf die Karte setzen.\n";
-LAB_080b91a9:
- // try { // try from 080b91a9 to 080b91ad has its CatchHandler @ 080b9270
- error(Text);
- }
- return;
- }
- // try { // try from 080b8d06 to 080b8e17 has its CatchHandler @ 080b9270
- pTVar4 = GetCreature(this->Master);
- if (pTVar4 == (TCreature *)0x0) {
- Text = "TMonster::TMonster: Master existiert nicht.\n";
- goto LAB_080b91a9;
- }
- if ((pTVar4->Type != MONSTER) || (pTVar4[1].super_TSkillBase.Skills[1] == (TSkill *)0x0)) {
- pTVar4->SummonedCreatures = pTVar4->SummonedCreatures + 1;
- (this->super_TNonplayer).super_TCreature.LifeEndRound = pTVar4->LifeEndRound;
- goto LAB_080b8d5a;
- }
- error(&DAT_08105b60);
- this->Master = (ulong)pTVar4[1].super_TSkillBase.Skills[1];
- } while( true );
-}
-
-
-
-// DWARF original prototype: void ~TMonster(TMonster * this, int __in_chrg)
-
-void __thiscall TMonster::~TMonster(TMonster *this,int __in_chrg)
-
-{
- bool bVar1;
- TCreature *pTVar2;
- TCreature *master;
- ulong in_stack_ffffffe8;
-
- bVar1 = (this->super_TNonplayer).super_TCreature.IsDead;
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TMonster_08127ca8;
- if (bVar1 == false) {
- in_stack_ffffffe8 = (this->super_TNonplayer).super_TCreature.posy;
- GraphicalEffect();
- }
- else if (this->Master == 0) {
- in_stack_ffffffe8 = RaceData[(this->super_TNonplayer).super_TCreature.Race].ExperiencePoints
- ;
- TCombat::DistributeExperiencePoints
- (&(this->super_TNonplayer).super_TCreature.Combat,in_stack_ffffffe8);
- }
- if (this->Home != 0) {
- NotifyMonsterhomeOfDeath(this->Home);
- }
- if (this->Master != 0) {
- pTVar2 = GetCreature(this->Master);
- if ((pTVar2 != (TCreature *)0x0) && (0 < pTVar2->SummonedCreatures)) {
- pTVar2->SummonedCreatures = pTVar2->SummonedCreatures + -1;
- }
- }
- TNonplayer::~TNonplayer(&this->super_TNonplayer,in_stack_ffffffe8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TMonster(TMonster * this, int __in_chrg)
-
-void __thiscall TMonster::~TMonster(TMonster *this,int __in_chrg)
-
-{
- bool bVar1;
- TCreature *pTVar2;
- TCreature *master;
- ulong in_stack_ffffffe8;
-
- bVar1 = (this->super_TNonplayer).super_TCreature.IsDead;
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TMonster_08127ca8;
- if (bVar1 == false) {
- in_stack_ffffffe8 = (this->super_TNonplayer).super_TCreature.posy;
- GraphicalEffect();
- }
- else if (this->Master == 0) {
- in_stack_ffffffe8 = RaceData[(this->super_TNonplayer).super_TCreature.Race].ExperiencePoints
- ;
- TCombat::DistributeExperiencePoints
- (&(this->super_TNonplayer).super_TCreature.Combat,in_stack_ffffffe8);
- }
- if (this->Home != 0) {
- NotifyMonsterhomeOfDeath(this->Home);
- }
- if (this->Master != 0) {
- pTVar2 = GetCreature(this->Master);
- if ((pTVar2 != (TCreature *)0x0) && (0 < pTVar2->SummonedCreatures)) {
- pTVar2->SummonedCreatures = pTVar2->SummonedCreatures + -1;
- }
- }
- TNonplayer::~TNonplayer(&this->super_TNonplayer,in_stack_ffffffe8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TMonster(TMonster * this, int __in_chrg)
-
-void __thiscall TMonster::~TMonster(TMonster *this,int __in_chrg)
-
-{
- bool bVar1;
- TCreature *pTVar2;
- TCreature *master;
- ulong in_stack_ffffffe8;
-
- bVar1 = (this->super_TNonplayer).super_TCreature.IsDead;
- (this->super_TNonplayer).super_TCreature._vptr_TCreature =
- (_func_int_varargs **)&PTR__TMonster_08127ca8;
- if (bVar1 == false) {
- in_stack_ffffffe8 = (this->super_TNonplayer).super_TCreature.posy;
- GraphicalEffect();
- }
- else if (this->Master == 0) {
- in_stack_ffffffe8 = RaceData[(this->super_TNonplayer).super_TCreature.Race].ExperiencePoints
- ;
- TCombat::DistributeExperiencePoints
- (&(this->super_TNonplayer).super_TCreature.Combat,in_stack_ffffffe8);
- }
- if (this->Home != 0) {
- NotifyMonsterhomeOfDeath(this->Home);
- }
- if (this->Master != 0) {
- pTVar2 = GetCreature(this->Master);
- if ((pTVar2 != (TCreature *)0x0) && (0 < pTVar2->SummonedCreatures)) {
- pTVar2->SummonedCreatures = pTVar2->SummonedCreatures + -1;
- }
- }
- TNonplayer::~TNonplayer(&this->super_TNonplayer,in_stack_ffffffe8);
- operator_delete(this);
- return;
-}
-
-
-
// WARNING: Globals starting with '_' overlap smaller symbols at the same address
// DWARF original prototype: void IdleStimulus(TMonster * this)
@@ -26737,50 +20458,6 @@ void _GLOBAL__I__Z13BeginSendDataP11TConnection(void) return;
}
-
-
-// WARNING: Variable defined which should be unmapped: Text_local
-
-void SendText(TConnection *Connection,char *Text,int Length)
-
-{
- int Offset;
- int iVar1;
- uchar *__dest;
- size_t __n;
- char *Text_local;
-
- if (Text == (char *)0x0) {
- error("SendText: Text ist NULL.\n");
- return;
- }
- if (0 < Length) {
- if ((Connection->NextToSend - Length) + 0x4000 < Connection->NextToWrite) {
- Connection->Overflow = true;
- }
- else {
- iVar1 = Connection->NextToWrite % 0x4000;
- if (Length + iVar1 < 0x4001) {
- __dest = Connection->OutData + iVar1;
- __n = Length;
- }
- else {
- memcpy(Connection->OutData + iVar1,Text,0x4000 - iVar1);
- __dest = Connection->OutData;
- Text = Text + (0x4000 - iVar1);
- __n = (Length + iVar1) - 0x4000;
- }
- memcpy(__dest,Text,__n);
- Connection->NextToWrite = Connection->NextToWrite + Length;
- }
- return;
- }
- error(&DAT_08109a60);
- return;
-}
-
-
-
void __static_initialization_and_destruction_0(int __initialize_p,int __priority)
{
|
