Thanks AndMetal, I honestly didn’t know which method was preferred. Sorry, I don’t have the energy at the moment to switch the int and int32s around. Though I did learn something and now know in the future.
Here is a diff of all the required code. Hopefully I got it all. With this the only required manual database entry is setting the zone insttype to 1. Required SQL Code:
ALTER TABLE `zone` ADD column `insttype` tinyint (1) zerofill unsigned NOT NULL default '0'; Line 498 insert Code:
ztz->requested_zone_id = database.GetInstZoneID(ztz->requested_zone_id, ztz->name); Code:
int server_id; Line 533 insert Code:
zlog(WORLD__ZONE,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); World\Client.cpp Line 644 insert Code:
zoneID = database.GetInstZoneID(zoneID, GetCharName()); Line 122 Code:
//Checks if the zone can be instanced, character has a instance flag, and Line 201 insert Code:
int32 GetCharInstFlagNum(int32 charID); Around Line 1173 Code:
const char* Database::GetZoneName(int32 zoneID, bool ErrorUnknown) { Code:
int32 Database::GetDfltInstZFlag(){ Append to the end Code:
int32 ZoneDatabase::GetInstType(int32 zoneid) { Code:
#include <string> Zone\zonedb.h line 194 change const char* zone_name to int32 zoneid Code:
bool PopulateZoneSpawnList(int32 zoneid, LinkedList<Spawn2*> &spawn2_list, int32 repopdelay = 0); At the end of Zone Related around line 181 Code:
int32 GetInstType(int32 zoneid); Zone.cpp Line 1146 change short_name to zoneid Code:
if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, delay)) Code:
if (!database.PopulateZoneSpawnList(zoneid, spawn2_list)) Zone.cpp Line 772 change short_name to zoneid Code:
else if (tmp == 0) { Code:
zone->ResetAuth(); Zone\spawn2.cpp line 226 Code:
bool ZoneDatabase::PopulateZoneSpawnList(int32 zoneid, LinkedList<Spawn2*> &spawn2_list, int32 repopdelay) { Insert at the end around line 1884 Code:
newXS(strcpy(buf, "setinstflag"), XS__setinstflag, file); Zone\perparser.cpp insert around line 1758 Code:
XS(XS__setinstflag); Zone\questmgr.h Insert around line 151 Code:
void setinstflag(int charID, int orgZoneID, int type); Insert at the end Code:
void QuestManager::setinstflag(int charID, int orgZoneID, int type) Code:
sub EVENT_SAY { |
In your questmgr.cpp you might have some leftover debug code.
Code:
say("Got to start of setinstflagmanually"); |
Oops, your right. Good catch.
Zone\questmgr.cpp at the end QuestManager::setinstflagmanually should be Code:
void QuestManager::setinstflagmanually(int charID, int orgZoneID, int instFlag) |
Anyone have a chance over the weekend to test this out? I would like to get this portion tested before I add some other features.
One thing I noticed while testing it on my minilogin server: Using two characters from the same account in an instance causes one to get disconnected when the other zones out of the instance. I think this is related to how the client/emu interact and likely cannot be fixed since Sony intended only one character to be logged in on the same account at a time. Though, I do not know if this problem would occur on a public server. Below are some things I want to implement once this code is tested. Quest function to delete instance flags (reset them to zero) Fix goto command so it works in instances Quest function to get the average level of a group and raid Hold dynamic and instance zones open for a set period of time. There is probably already a short timer in the code that is triggered when a zone becomes empty so I will just need to find it and allow the time to be set from a database entry. I had more but cannot remember them at the moment. |
I didn't actually test the instances (though they worked for me earlier) However, I can confirm all the types flag me properly and don't cause a crash anymore. Nice work!
|
Yep more changes.
This is a fix for setinstflagmanually to allow manual flagging of raids, groups, and individuals. This also offers a way to delete instance flags by sending a orgZoneID of -1 and a instFlag of -1 to the function. Please note if you have already setup quests to use the setinstflagmanually you will need to add a fourth parameter to it. Format for quests - setinstflagmanually(charID, orginalZoneID, instFlag, type) types 0 = individual 1 = group 2 = raid 3 = individual, group, and raid Zone\perlparser.cpp Find XS(XS__setinstflagmanually) replace with below code (line is 1774 on mine but..) Code:
XS(XS__setinstflagmanually); Find void QuestManager::setinstflagmanually and replace with below code (line 1420 on mine) Code:
void QuestManager::setinstflagmanually(int charID, int orgZoneID, int instFlag, int type) Find void setinstflagmanually and replace with below code (line 151 on mine) Code:
void setinstflagmanually(int charID, int orgZoneID, int instFlag, int type); |
Some thoughts…
Code:
//Copies original zones information into a new zone entry replacing the old zoneidnumber with the instflagnum (The shutdowndelay column needs added, I will add it tonight or tomorrow) Also, I am reluctant to enable inheriting of instance flags in groups and raids because it may allow players to circumvent zone limitations. For example, Group zones into an LDoN 1 member drops out of the group but stays in the LDoN The group then invites another character. He/she zones into the LDoN (because he/she now has the flag) Now 7 characters are in the zone when the content was built for 6. To keep players from doing this we would either have to boot them from the instance when they disband or have a hidden NPC check the zone every few minutes for players without the correct instance flag. Any thoughts? Another side note, I may have a fix for the goto command but I need to test it. |
tecnicly speaking on LIVE after you zoned into LDON and someone Lds, camps, crashes etc- you CANNOT invite someone else from outside- the zone should remain LOCKED until adventure expires or forfeit, even if group inside got smaller
|
Fix to include shutdowndelay column in zone copy
zone\zonedb.cpp Find ZoneDatabase::LoadInstZone(int32 target_zone_ID, int32 instFlagNum) Replace Line 17 inside the function (line 1542 for whole file (Rev98 )) Code:
if (RunQuery(query, MakeAnyLenString(&query, "INSERT INTO zone (short_name, file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, zoneidnumber, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer) SELECT '%s', file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, %i, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer FROM zone WHERE zoneidnumber =%i", temp2,instFlagNum,target_zone_ID), errbuf, 0, &affected_rows)){ Code:
if (RunQuery(query, MakeAnyLenString(&query, "INSERT INTO zone (short_name, file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, zoneidnumber, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer, shutdowndelay) SELECT '%s', file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, %i, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer, shutdowndelay FROM zone WHERE zoneidnumber =%i", temp2,instFlagNum,target_zone_ID), errbuf, 0, &affected_rows)){ ChaosSlayer, I think you are right about the LDoNs. Everyone had to be in the group before the LDoN task was accepted or they could not get into the zone. Though, I think GoD and OoW instances flags could be shared via the share task button. |
Thought I'd add... With the instancing ability we need to add a new check to the /goto <playername> command so it will check the characters_ table and replicate any instance flags on the GM before zoning. That way if someone is stuck in the geometry or bugged death or whatever a GM can zone into that instance and check.
|
Quote:
|
All times are GMT -4. The time now is 05:52 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.