From: <ken...@us...> - 2009-03-25 00:40:38
|
Revision: 3304 http://planeshift.svn.sourceforge.net/planeshift/?rev=3304&view=rev Author: kennygraunke Date: 2009-03-25 00:40:29 +0000 (Wed, 25 Mar 2009) Log Message: ----------- - Removed TARGET_NPC and TARGET_PVP target types. Just use FRIEND or FOE. Modified Paths: -------------- trunk/docs/history.txt trunk/src/server/client.cpp trunk/src/server/client.h trunk/src/server/database/mysql/spells.sql trunk/src/server/database/mysql/upgrade_schema.sql trunk/src/server/psserver.cpp Modified: trunk/docs/history.txt =================================================================== --- trunk/docs/history.txt 2009-03-24 23:22:02 UTC (rev 3303) +++ trunk/docs/history.txt 2009-03-25 00:40:29 UTC (rev 3304) @@ -7,8 +7,9 @@ hand. Yet, this is not sensible, because scripts don't check for NULL and just presume the object really exists. Now we use "Fist", as if the hand was empty, so we get a real weapon with a small amount of blunt damage. +- Removed TARGET_NPC and TARGET_PVP target types. Just use FRIEND or FOE. + ==> DB VERSION BUMP: 1216 <== - *** 2009-03-24 by Stefano Angeleri - Made newacct auto enable created accounts, additionally added an optional argument to define the security level of the account user/pass/seclevel Modified: trunk/src/server/client.cpp =================================================================== --- trunk/src/server/client.cpp 2009-03-24 23:22:02 UTC (rev 3303) +++ trunk/src/server/client.cpp 2009-03-25 00:40:29 UTC (rev 3304) @@ -427,9 +427,6 @@ case TARGET_NONE: sMsg = "You must select a target to attack."; break; - case TARGET_NPC: - sMsg = "%s is impervious to attack."; - break; case TARGET_ITEM: sMsg = "You can't attack an inanimate object."; break; @@ -464,8 +461,6 @@ } } break; - case TARGET_PVP: /* Attackable player */ - break; } if ( sMsg != NULL ) @@ -504,7 +499,7 @@ if (target->GetCharacterData()->impervious_to_attack) { - return TARGET_NPC; /* Impervious NPC */ + return TARGET_FRIEND; /* Impervious NPC */ } // Is target a NPC? @@ -527,13 +522,13 @@ return TARGET_GM; /* Invincible GM */ if (targetclient->GetActor()->attackable) - return TARGET_PVP; /* attackable GM */ + return TARGET_FOE; /* attackable GM */ // Challenged to a duel? if (IsDuelClient(target->GetClientID()) || targetclient->IsDuelClient(clientnum)) { - return TARGET_PVP; /* Attackable player */ + return TARGET_FOE; /* Attackable player */ } // In PvP region? @@ -546,7 +541,7 @@ if (psserver->GetCombatManager()->InPVPRegion(attackerpos,attackersector) && psserver->GetCombatManager()->InPVPRegion(targetpos,targetsector)) { - return TARGET_PVP; /* Attackable player */ + return TARGET_FOE; /* Attackable player */ } // Is this a player who has hit you and run out of a PVP area? @@ -555,7 +550,7 @@ const DamageHistory *dh = GetActor()->GetDamageHistory((int)i); // If the target has ever hit you, you can attack them back. Logging out clears this. if (dh->attacker_ref.IsValid() && dh->attacker_ref->GetActorPtr() == target) - return TARGET_PVP; + return TARGET_FOE; } // Declared war? @@ -564,7 +559,7 @@ if (attackguild && targetguild && targetguild->IsGuildWarActive(attackguild)) { - return TARGET_PVP; /* Attackable player */ + return TARGET_FOE; /* Attackable player */ } return TARGET_FRIEND; /* Friend */ @@ -587,13 +582,11 @@ { targetDesc.Clear(); TestTarget(targetDesc, targetType, TARGET_NONE, "the surrounding area"); - TestTarget(targetDesc, targetType, TARGET_NPC, "living associates"); TestTarget(targetDesc, targetType, TARGET_ITEM, "items"); TestTarget(targetDesc, targetType, TARGET_SELF, "yourself"); TestTarget(targetDesc, targetType, TARGET_FRIEND, "living friends"); - TestTarget(targetDesc, targetType, TARGET_FOE, "living monsters"); + TestTarget(targetDesc, targetType, TARGET_FOE, "living enemies"); TestTarget(targetDesc, targetType, TARGET_DEAD, "the dead"); - TestTarget(targetDesc, targetType, TARGET_PVP, "living people"); } bool Client::IsAlive(void) const Modified: trunk/src/server/client.h =================================================================== --- trunk/src/server/client.h 2009-03-24 23:22:02 UTC (rev 3303) +++ trunk/src/server/client.h 2009-03-25 00:40:29 UTC (rev 3304) @@ -60,14 +60,12 @@ enum TARGET_TYPES { TARGET_NONE = 0x01, /* Also Area */ - TARGET_NPC = 0x02, TARGET_ITEM = 0x04, TARGET_SELF = 0x08, TARGET_FRIEND = 0x10, TARGET_FOE = 0x20, TARGET_DEAD = 0x40, - TARGET_GM = 0x80, - TARGET_PVP = 0x100 + TARGET_GM = 0x80 }; enum CheatFlags // will have more of these as Paladin gets better Modified: trunk/src/server/database/mysql/spells.sql =================================================================== --- trunk/src/server/database/mysql/spells.sql 2009-03-24 23:22:02 UTC (rev 3303) +++ trunk/src/server/database/mysql/spells.sql 2009-03-25 00:40:29 UTC (rev 3304) @@ -12,7 +12,7 @@ `spell_description` text, `offensive` boolean DEFAULT true, `max_power` int(4) DEFAULT '1', - `target_type` int(4) DEFAULT '32', + `target_type` int(4) DEFAULT 0x20, `exclude_target` boolean DEFAULT false, `cast_duration` text NOT NULL, /* (power, wayskill, relatedstat) -> seconds */ `range` text, /* (power, wayskill, relatedstat) -> meters */ @@ -30,10 +30,10 @@ * Sample/fake spells */ -INSERT INTO spells VALUES(1,"Summon Missile",1,1,"casting","","You summon a wooden arrow and magically shoot it at your target.",true,1,288,false,"5000-(WaySkill+RelatedStat)/Power","40*Power","0","0","cast Summon Missile",163,"1.000"); -INSERT INTO spells VALUES(2,"Life Infusion",1,1,"casting","","By means of this spell the wizard is able to instill pure energy in a creature. The energy, which has healing effects, is less powerful but similar to the energy of the Great Crystal. It can be cast on the wizard or on another character in touch range.",false,1,24,false,"1000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Life Infusion","164","1.000"); -INSERT INTO spells VALUES(3,"Swiftness",2,1,"casting","","This spell increases the agility of the caster for a time.",false,1,24,false,"1000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Swiftness","164","1.000"); -INSERT INTO spells VALUES(4,"Dispel",1,1,"casting","","This spell cancels various benificial status effects on your target.",false,1,314,false,"2000-(WaySkill+RelatedStat)/Power","3+Power","0","0","cast Dispel",164,"1.000"); -INSERT INTO spells VALUES(5,"Flame Spire",3,1,"casting","","This spells creates a spire of flames all around the caster.",false,1,24,false,"2000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Flame Spire",167,0.000); -INSERT INTO spells VALUES(6,"Magetank",3,1,"casting","","Everybody wants to play one...",false,1,24,false,"2000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Magetank",167,0.000); -INSERT INTO spells VALUES(7,"Drain",4,1,"casting","","This spell drains the life of your opponent, over time, and gives some of it back to you.",true,1,288,false,"2000-(WaySkill+RelatedStat)/Power","15.0","0","0","cast Drain",163,1.000); +INSERT INTO spells VALUES(1,"Summon Missile",1,1,"casting","","You summon a wooden arrow and magically shoot it at your target.",true,1,0x20,false,"5000-(WaySkill+RelatedStat)/Power","40*Power","0","0","cast Summon Missile",163,"1.000"); +INSERT INTO spells VALUES(2,"Life Infusion",1,1,"casting","","By means of this spell the wizard is able to instill pure energy in a creature. The energy, which has healing effects, is less powerful but similar to the energy of the Great Crystal. It can be cast on the wizard or on another character in touch range.",false,1,0x18,false,"1000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Life Infusion","164","1.000"); +INSERT INTO spells VALUES(3,"Swiftness",2,1,"casting","","This spell increases the agility of the caster for a time.",false,1,0x18,false,"1000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Swiftness","164","1.000"); +INSERT INTO spells VALUES(4,"Dispel",1,1,"casting","","This spell cancels various benificial status effects on your target.",false,1,0x38,false,"2000-(WaySkill+RelatedStat)/Power","3+Power","0","0","cast Dispel",164,"1.000"); +INSERT INTO spells VALUES(5,"Flame Spire",3,1,"casting","","This spells creates a spire of flames all around the caster.",false,1,0x8,false,"2000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Flame Spire",167,0.000); +INSERT INTO spells VALUES(6,"Magetank",3,1,"casting","","Everybody wants to play one...",false,1,0x18,false,"2000-(WaySkill+RelatedStat)/Power","3.0","0","0","cast Magetank",167,0.000); +INSERT INTO spells VALUES(7,"Drain",4,1,"casting","","This spell drains the life of your opponent, over time, and gives some of it back to you.",true,1,0x20,false,"2000-(WaySkill+RelatedStat)/Power","15.0","0","0","cast Drain",163,1.000); Modified: trunk/src/server/database/mysql/upgrade_schema.sql =================================================================== --- trunk/src/server/database/mysql/upgrade_schema.sql 2009-03-24 23:22:02 UTC (rev 3303) +++ trunk/src/server/database/mysql/upgrade_schema.sql 2009-03-25 00:40:29 UTC (rev 3304) @@ -1135,9 +1135,13 @@ ALTER TABLE loot_modifiers DROP COLUMN prg_evt_unequip; ALTER TABLE loot_modifiers CHANGE prg_evt_equip equip_script text NULL AFTER not_usable_with; --- Also needs manual updates to the equip_script operations. UPDATE `server_options` SET `option_value`='1215' WHERE `option_name`='db_version'; +#### 1216 - Kenny Graunke - Remove TARGET_NPC and TARGET_PVP from spell target types. +UPDATE `spells` SET target_type = target_type & ~0x102; + +UPDATE `server_options` SET `option_value`='1216' WHERE `option_name`='db_version'; + # Insert your upgrade before this line. Remember when you set a new db_version # to update the server_options.sql file and update psserver.cpp as well. # This to ensure that everything is working if you use the create_all.sql to Modified: trunk/src/server/psserver.cpp =================================================================== --- trunk/src/server/psserver.cpp 2009-03-24 23:22:02 UTC (rev 3303) +++ trunk/src/server/psserver.cpp 2009-03-25 00:40:29 UTC (rev 3304) @@ -89,7 +89,7 @@ #include "workmanager.h" // Remember to bump this in server_options.sql and add to upgrade_schema.sql! -#define DATABASE_VERSION_STR "1215" +#define DATABASE_VERSION_STR "1216" psCharacterLoader psServer::CharacterLoader; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |