They changed a few things in their requirements so I guess it can explain several stuff.
It should fix the following issues:
-> no announcement when not enough people for Union War,
-> Union War not starting even if there were enough people,
REPLACE:
- if(ObjvarIndex==2&&refNPC>=1088&&refNPC<=1091&&(orgvalue==30||orgvalue==33))
- {
- if(orgvalue==30&&data->btOp==2)
- {
- orgvalue=GServer->UWNbPlayers;
- LogDebug("QSDC11::UW We trapped NPC %i[%i]>=%i (replaces >= %i)",refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- if(orgvalue==33&&data->btOp==4)
- {
- orgvalue=GServer->UWNbPlayers+3;
- LogDebug("QSDC11::UW We trapped NPC %i[%i]<=%i (replaces <= %i)",refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- }
BY:
- if(ObjvarIndex==2&&refNPC>=1088&&refNPC<=1091&&(orgvalue==20||orgvalue==23))
- {
- if(orgvalue==20&&data->btOp==2)
- {
- orgvalue=GServer->UWNbPlayers;
- LogDebug("QSDC11::UW We trapped NPC %i[%i]>=%i (replaces >= %i)",refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- if(orgvalue==23&&data->btOp==4)
- {
- orgvalue=GServer->UWNbPlayers+3;
- LogDebug("QSDC11::UW We trapped NPC %i[%i]<=%i (replaces <= %i)",refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- }
REPLACE:
- if(ObjvarIndex==2&&monster->thisnpc->refNPC>=1088&&monster->thisnpc->refNPC<=1091&&(orgvalue==30||orgvalue==33))
- {
- if(orgvalue==30&&data->btOp==2)
- {
- orgvalue=GServer->UWNbPlayers;
- LogDebug("QSDCC11::UW We trapped NPC %i[%i]>=%i (replaces >= %i)",monster->thisnpc->refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- if(orgvalue==33&&data->btOp==4)
- {
- orgvalue=GServer->UWNbPlayers+3;
- LogDebug("QSDCC11::UW We trapped NPC %i[%i]<=%i (replaces <= %i)",monster->thisnpc->refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- }
BY:
- if(ObjvarIndex==2&&monster->thisnpc->refNPC>=1088&&monster->thisnpc->refNPC<=1091&&(orgvalue==20||orgvalue==23))
- {
- if(orgvalue==20&&data->btOp==2)
- {
- orgvalue=GServer->UWNbPlayers;
- LogDebug("QSDCC11::UW We trapped NPC %i[%i]>=%i (replaces >= %i)",monster->thisnpc->refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- if(orgvalue==23&&data->btOp==4)
- {
- orgvalue=GServer->UWNbPlayers+3;
- LogDebug("QSDCC11::UW We trapped NPC %i[%i]<=%i (replaces <= %i)",monster->thisnpc->refNPC,ObjvarIndex,orgvalue,data->iValue);
- }
- }
REPLACE:
- if(data->btMsgType == 1)
- {
- //LogDebug("%s shouts Nb %i::%s",GServer->LtbstringQSD[data->iStrID]->NPCname,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCShout(thisMonster,GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->LtbstringQSD[data->iStrID]->NPCname);
- //LogDebug("%s (%i) shouts Nb %i::%s",GServer->GetNPCNameByType(thisMonster->aip_npctype),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCShout(thisMonster,GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetNPCNameByType(thisMonster->aip_npctype));
- LogDebug("%s (%i) shouts Nb %i::%s",GServer->GetSTLMonsterNameByID(good_npc),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- GServer->NPCShout(thisMonster,GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetSTLMonsterNameByID(good_npc));
- }
- else if(data->btMsgType == 2)
- {
- //LogDebug("%s (%i) announces Nb %i::%s",GServer->GetNPCNameByType(thisMonster->aip_npctype),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCAnnounce(GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetNPCNameByType(thisMonster->aip_npctype));
- LogDebug("%s (%i) announces Nb %i::%s",GServer->GetSTLMonsterNameByID(good_npc),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- GServer->NPCAnnounce(GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetSTLMonsterNameByID(good_npc),thisMonster->Position->Map);
- }
BY:
- //LMA: sometimes another NPC/monster calls another NPC to shoot.
- //we have to find the right one.
- int good_map=thisMonster->Position->Map;
- if (thisMonster->thisnpc->refNPC!=0&&thisMonster->thisnpc->refNPC!=thisMonster->aip_npctype)
- {
- CNPC* findNPC=GServer->GetNPCByType(thisMonster->thisnpc->refNPC);
- if(findNPC!=NULL)
- {
- good_map=findNPC->posMap;
- }
- }
- if(data->btMsgType == 1)
- {
- //LogDebug("%s shouts Nb %i::%s",GServer->LtbstringQSD[data->iStrID]->NPCname,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCShout(thisMonster,GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->LtbstringQSD[data->iStrID]->NPCname);
- //LogDebug("%s (%i) shouts Nb %i::%s",GServer->GetNPCNameByType(thisMonster->aip_npctype),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCShout(thisMonster,GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetNPCNameByType(thisMonster->aip_npctype));
- LogDebug("%s (%i) shouts Nb %i::%s",GServer->GetSTLMonsterNameByID(good_npc),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCShout(thisMonster,GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetSTLMonsterNameByID(good_npc));
- GServer->NPCShout(thisMonster,GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetSTLMonsterNameByID(good_npc),good_map);
- }
- else if(data->btMsgType == 2)
- {
- //LogDebug("%s (%i) announces Nb %i::%s",GServer->GetNPCNameByType(thisMonster->aip_npctype),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCAnnounce(GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetNPCNameByType(thisMonster->aip_npctype));
- LogDebug("%s (%i) announces Nb %i::%s",GServer->GetSTLMonsterNameByID(good_npc),thisMonster->aip_npctype,data->iStrID,GServer->LtbstringQSD[data->iStrID]->LTBstring);
- //GServer->NPCAnnounce(GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetSTLMonsterNameByID(good_npc),thisMonster->Position->Map);
- GServer->NPCAnnounce(GServer->LtbstringQSD[data->iStrID]->LTBstring,GServer->GetSTLMonsterNameByID(good_npc),good_map);
- }
If you want to test, be sure to read this thread to use the gm commands /setuw and /setuwnb:
viewtopic.php?f=18&t=2585&p=30839&hilit=uwnbplayers#p30839






