diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-04-25 11:43:11 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-04-25 11:43:11 -0300 |
commit | 8ab8e18a0d3377cea610ec7f7cedc9236edd5871 (patch) | |
tree | 673c6198d24d76eef1074e0679ba35b07a5d30e8 | |
parent | 4d06e3796632e6200d5ec8cf0b5266347ff9d6bf (diff) | |
download | serverdata-8ab8e18a0d3377cea610ec7f7cedc9236edd5871.tar.gz serverdata-8ab8e18a0d3377cea610ec7f7cedc9236edd5871.tar.bz2 serverdata-8ab8e18a0d3377cea610ec7f7cedc9236edd5871.tar.xz serverdata-8ab8e18a0d3377cea610ec7f7cedc9236edd5871.zip |
Alpha version of spotlight system - requires a fixed clientdata!119 or won't work
-rw-r--r-- | db/re/item_db.conf | 33 | ||||
-rw-r--r-- | npc/001-3-0/_warps.txt | 6 | ||||
-rw-r--r-- | npc/001-3-1/_warps.txt | 3 | ||||
-rw-r--r-- | npc/001-3-2/_warps.txt | 1 | ||||
-rw-r--r-- | npc/008-3-0/_warps.txt | 1 | ||||
-rw-r--r-- | npc/008-3-1/_warps.txt | 1 | ||||
-rw-r--r-- | npc/008-4-1/_warps.txt | 1 | ||||
-rw-r--r-- | npc/functions/masks.txt | 1 | ||||
-rw-r--r-- | npc/functions/spotlight.txt | 71 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
10 files changed, 110 insertions, 9 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 96293603..40f51c00 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -3823,7 +3823,6 @@ item_db: ( Atk: 0 Matk: -25 Def: 180 - Range: 0 Slots: 0 Loc: "EQP_HEAD_TOP" WeaponLv: 0 @@ -3831,8 +3830,12 @@ item_db: ( Refine: false ViewSprite: 2907 BindOnEquip: false - Delay: 0 - Sprite: 0 + OnEquipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> + OnUnequipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> }, { Id: 2908 @@ -4192,8 +4195,12 @@ item_db: ( Refine: false Subtype: "W_STAFF" BindOnEquip: false - Delay: 0 - Sprite: 0 + OnEquipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> + OnUnequipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> Script: <" skill AL_HEAL, 1; bonus bMagicAtkDef, 10; @@ -4218,8 +4225,12 @@ item_db: ( Refine: false Subtype: "W_STAFF" BindOnEquip: false - Delay: 0 - Sprite: 0 + OnEquipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> + OnUnequipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> Script: <" skill MG_FIREBALL, 1; bonus bMatkRate, 10; @@ -4334,8 +4345,12 @@ item_db: ( Refine: false Subtype: "W_DAGGER" BindOnEquip: false - Delay: 0 - Sprite: 0 + OnEquipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> + OnUnequipScript: <" + doevent "#SpotlightMaster::OnTouch"; + "> }, { Id: 3512 diff --git a/npc/001-3-0/_warps.txt b/npc/001-3-0/_warps.txt index d192e4ef..2a179e1c 100644 --- a/npc/001-3-0/_warps.txt +++ b/npc/001-3-0/_warps.txt @@ -1,8 +1,14 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // Map 001-3-0: Sewer warps 001-3-0,196,35,0 warp #001-3-0_196_35 0,0,001-1,197,35 +001-3-0,196,35,0 duplicate(#SpotlightMaster) #SPOT001-3-0_196_35 NPC_HIDDEN,2,2 001-3-0,172,41,0 warp #001-3-0_172_41 0,0,001-3-1,34,58 +001-3-0,172,41,0 duplicate(#SpotlightMaster) #SPOT001-3-0_172_41 NPC_HIDDEN,2,2 001-3-0,162,40,0 warp #001-3-0_162_40 0,0,001-3-1,23,57 +001-3-0,162,40,0 duplicate(#SpotlightMaster) #SPOT001-3-0_162_40 NPC_HIDDEN,2,2 001-3-0,198,60,0 warp #001-3-0_198_60 0,0,001-1,199,61 +001-3-0,198,60,0 duplicate(#SpotlightMaster) #SPOT001-3-0_198_60 NPC_HIDDEN,2,2 001-3-0,152,55,0 warp #001-3-0_152_55 0,0,001-1,152,51 +001-3-0,152,55,0 duplicate(#SpotlightMaster) #SPOT001-3-0_152_55 NPC_HIDDEN,2,2 001-3-0,85,130,0 warp #001-3-0_85_130 0,0,001-1,86,130 +001-3-0,85,130,0 duplicate(#SpotlightMaster) #SPOT001-3-0_85_130 NPC_HIDDEN,2,2 diff --git a/npc/001-3-1/_warps.txt b/npc/001-3-1/_warps.txt index 4f79c590..bf4d27e8 100644 --- a/npc/001-3-1/_warps.txt +++ b/npc/001-3-1/_warps.txt @@ -1,5 +1,8 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // Map 001-3-1: Rivercave warps 001-3-1,24,58,0 warp #001-3-1_24_58 1,0,001-3-0,162,41 +001-3-1,24,58,0 duplicate(#SpotlightMaster) #SPOT001-3-1_24_58 NPC_HIDDEN,2,2 001-3-1,35,59,0 warp #001-3-1_35_59 1,0,001-3-0,172,42 +001-3-1,35,59,0 duplicate(#SpotlightMaster) #SPOT001-3-1_35_59 NPC_HIDDEN,2,2 001-3-1,30,19,0 warp #001-3-1_30_19 0,0,001-3-2,30,116 +001-3-1,30,19,0 duplicate(#SpotlightMaster) #SPOT001-3-1_30_19 NPC_HIDDEN,2,2 diff --git a/npc/001-3-2/_warps.txt b/npc/001-3-2/_warps.txt index 6b35b231..a73ad560 100644 --- a/npc/001-3-2/_warps.txt +++ b/npc/001-3-2/_warps.txt @@ -1,3 +1,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // Map 001-3-2: Hideout warps 001-3-2,30,117,0 warp #001-3-2_30_117 0,0,001-3-1,30,20 +001-3-2,30,117,0 duplicate(#SpotlightMaster) #SPOT001-3-2_30_117 NPC_HIDDEN,2,2 diff --git a/npc/008-3-0/_warps.txt b/npc/008-3-0/_warps.txt index 7426d274..f99ab700 100644 --- a/npc/008-3-0/_warps.txt +++ b/npc/008-3-0/_warps.txt @@ -1,3 +1,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // Map 008-3-0: Rossy Cave warps 008-3-0,130,113,0 warp #008-3-0_130_113 1,0,008-1-1,202,48 +008-3-0,130,113,0 duplicate(#SpotlightMaster) #SPOT008-3-0_130_113 NPC_HIDDEN,2,2 diff --git a/npc/008-3-1/_warps.txt b/npc/008-3-1/_warps.txt index 221789b7..eb17b2d2 100644 --- a/npc/008-3-1/_warps.txt +++ b/npc/008-3-1/_warps.txt @@ -1,3 +1,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // Map 008-3-1: Bat Cave warps 008-3-1,34,34,0 warp #008-3-1_34_34 0,0,008-1,128,139 +008-3-1,34,34,0 duplicate(#SpotlightMaster) #SPOT008-3-1_34_34 NPC_HIDDEN,2,2 diff --git a/npc/008-4-1/_warps.txt b/npc/008-4-1/_warps.txt index b1a26ad0..325decc9 100644 --- a/npc/008-4-1/_warps.txt +++ b/npc/008-4-1/_warps.txt @@ -1,3 +1,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // Map 008-4-1: Cave Of Trials warps 008-4-1,175,18,0 warp #008-4-1_175_18 2,0,008-1,165,170 +008-4-1,175,18,0 duplicate(#SpotlightMaster) #SPOT008-4-1_175_18 NPC_HIDDEN,2,2 diff --git a/npc/functions/masks.txt b/npc/functions/masks.txt index 03c81630..4b28bfc7 100644 --- a/npc/functions/masks.txt +++ b/npc/functions/masks.txt @@ -1,6 +1,7 @@ // Evol functions. // Author: // Reid +// Jesusalva // Description: // Triggers functions to add and remove masks. // Variables: diff --git a/npc/functions/spotlight.txt b/npc/functions/spotlight.txt new file mode 100644 index 00000000..aa35a763 --- /dev/null +++ b/npc/functions/spotlight.txt @@ -0,0 +1,71 @@ +// Evol functions. +// Author: +// Jesusalva +// Micksha +// Description: +// Update spotlight on caves +// Variables: +// 2 - the darkest mask +// 4 - the average mask +// 8 - the lightest mask + +// forced_update - if set to true, will ignore if the map is known as valid +// (required for instance maps) +// updateSpotlight ( {forced_update} ) +function script updateSpotlight { + // A small delay of 80 ms in case player is changing map + // It will be cast twice when switching caves. This sleep prevents obscure bugs. + sleep2(80); + + // Maps which this system + setarray .@mapz$, + "001-3-0", "001-3-1", "001-3-2", + "008-3-0", "008-3-1", "008-4-1"; + + getmapxy(.@m$, .@x, .@y, 0); + debugmes "Begin"; + + // Is your map valid (or is the check skipped) + if (getarg(0,false)) + { + if (array_find(.@mapz$, .@m$) < 0) + return; + } + + // Retrieve default map masks + .@ms=getmapmask(.@m$); + debugmes "Default: %d", .@ms; + + // Which equipments provide bonuses? + setarray .@b_head, CandleHelmet; + setarray .@b_weapon, ManaTorch, TrainingWand, Torch; + + // Calc your lighting score (it should NOT start on zero) + .@score=1; + if (array_find(.@b_head, getequipid(EQI_HEAD_TOP)) >= 0) + .@score+=1; + if (array_find(.@b_weapon, getequipid(EQI_HAND_R)) >= 0) + .@score+=1; + + debugmes "Score: %d", .@score; + debugmes "Equips: %d and %d", getequipid(EQI_HEAD_TOP), getequipid(EQI_HAND_R); + debugmes "Headvalue: %d", .@b_head[0]; + debugmes "Weappnvalue: %d, %d, %d", .@b_weapon[0], .@b_weapon[1], .@b_weapon[2]; + // Sanitize score + .@score=min(3, .@score); + + // Calculate and send new map mask + .@ms=.@ms|(2**.@score); + sendmapmask(.@ms); + debugmes "Data sent: %d", .@ms; + return; +} + +// MAIN FUNCTION - DO NOT REMOVE +// Every NPC will be duplicating this one +001-3-0,0,0,0 script #SpotlightMaster NPC_HIDDEN,0,0,{ +OnTouch: + updateSpotlight(); + end; +} + diff --git a/npc/scripts.conf b/npc/scripts.conf index ca2bf288..1b7e85e6 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -28,6 +28,7 @@ "npc/functions/marriage.txt", "npc/functions/npcmove.txt", "npc/functions/masks.txt", +"npc/functions/spotlight.txt", "npc/functions/openbook.txt", "npc/functions/questgen.txt", "npc/functions/sailordialogue.txt", |