Jump to content
  • 0

MySQL Damage Scripts


BigCrazyCat

Question

Hey! Anybody has a script that damages objects as wall,doors after some time?

Like this:

UPDATE `Object_DATA` 
SET `Damage`=`Damage`+ 0.1 
WHERE `ObjectUID` <> 0 
	AND `CharacterID` <> 0 
	AND `LastUpdated` < DATE_SUB(NOW() , INTERVAL 3 DAY)
	AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );

But the script does not work well , because once destroys all the buildings.

Need Your HELP!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
/* Set Damage on all other objects */
UPDATE `object_data`
SET `Damage`=0.2
WHERE `ObjectUID` <> 0
AND `CharacterID` <> 0
AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );

/* Set Damage On Doors/Plot Poles using Door Management via Age */
UPDATE `object_data`
SET `Damage`=0.2
WHERE `Classname` IN ('Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
AND `Inventory` != '[]';
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...