gergecoelho
Apprentice
Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0
|
"Rare" Spawner Event
Hello, everyone! Just back from a while away from scripting.
So, let's get to it: I'm having problems while trying to apply a randomizer to my NPC spawns (something to buff their stats up for rare/boss random automated spawning).
I've added my event over there:
//Events related to all pets
EventsPet=your_event
But by checking via ".set show events" the NPCs are all blank of events.
What would be some possible reasons for that? Since the event triggers on @Create, I need it to be applied before the NPC spawns, what could be some workaround if the EventsPet wouldn't cover it?
Thanks in advance!
(This post was last modified: 05-05-2017 10:16 AM by gergecoelho.)
|
|
04-29-2017 02:06 AM |
|
|
gergecoelho
Apprentice
Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0
|
RE: NPC Events not being applied
Oh, then it's even better than I thought. Though the script isn't working for some OTHER reason.
See if you can make any sense of this (it's the event on EventsPet):
Code:
[TYPEDEF e_NPC_Triumphus] //NPC Spawn
ON=@Create
ALLSKILLS = (100 + (<TAG.LEVEL> * 80))
IF (<TAG.NPCCLASS> == 1) //Brute
STR = (18 + (<TAG.LEVEL> * 8) + {1 3})
DEX = (3 + (<TAG.LEVEL> * 8) + {1 3})
INT = (-3 + (<TAG.LEVEL> * 8) + {1 3})
MAXHITS = STR+20
HITS = MAXHITS
EVENTS +e_brute
ENDIF
IF (<TAG.NPCCLASS> == 2) //Soldier
STR = (13 + (<TAG.LEVEL> * 8) + {1 3})
DEX = (8 + (<TAG.LEVEL> * 8) + {1 3})
INT = (3 + (<TAG.LEVEL> * 8) + {1 3})
MAXHITS = STR+15
HITS = MAXHITS
EVENTS +e_soldier
ENDIF
IF (<TAG.NPCCLASS> == 3) //Artillery
STR = (3 + (<TAG.LEVEL> * 8) + {1 3})
DEX = (23 + (<TAG.LEVEL> * 8) + {1 3})
INT = (3 + (<TAG.LEVEL> * 8) + {1 3})
MAXHITS = STR+10
HITS = MAXHITS
EVENTS +e_artillery
ENDIF
IF (<TAG.NPCCLASS> == 4) //Skirmisher
STR = (8 + (<TAG.LEVEL> * 8) + {1 3})
DEX = (23 + (<TAG.LEVEL> * 8) + {1 3})
INT = (-3 + (<TAG.LEVEL> * 8) + {1 3})
MAXHITS = STR+15
HITS = MAXHITS
EVENTS +e_skirmisher
ENDIF
IF (<TAG.NPCCLASS> == 5) //Lurker
STR = (13 + (<TAG.LEVEL> * 8) + {1 3})
DEX = (23 + (<TAG.LEVEL> * 8) + {1 3})
INT = (-3 + (<TAG.LEVEL> * 8) + {1 3})
MAXHITS = STR+10
HITS = MAXHITS
EVENTS +e_lurker
ENDIF
IF (<TAG.NPCCLASS> == 6) //Controller
STR = (3 + (<TAG.LEVEL> * 8) + {1 3})
DEX = (-3 + (<TAG.LEVEL> * 8) + {1 3})
INT = (23 + (<TAG.LEVEL> * 8) + {1 3})
MAXHITS = STR+5
HITS = MAXHITS
EVENTS +e_controller
ENDIF
IF (<TAG.NPCCLASS> == 7) //Support
STR = (3 + (<TAG.LEVEL> * 8) + {1 3})
DEX = (-3 + (<TAG.LEVEL> * 8) + {1 3})
INT = (23 + (<TAG.LEVEL> * 8) + {1 3})
MAXHITS = STR+5
HITS = MAXHITS
EVENTS +e_support
ENDIF
VAR.RAND = <EVAL {1 500}> //Random chance for rare spawn
IF (<VAR.RAND> == 1)
NAME = "Master "+<NAME>
STR += (<STR> * 2,5)
STR += (<DEX> * 2,5)
STR += (<INT> * 2,5)
Allskills = 100.0
MAXHITS += 250
HITS = MAXHITS
COLOR = colors_all
OSKIN = COLOR
ENDIF
IF (<VAR.RAND> >= 2) && (<VAR.RAND> <= 6)
NAME = "Paragon "+<NAME>
STR += (<STR> * 1,5)
STR += (<DEX> * 1,5)
STR += (<INT> * 1,5)
Allskills = (<I.Anatomy> + (<I.Anatomy> * 1,5))
MAXHITS += 150
HITS = MAXHITS
COLOR = colors_all
OSKIN = COLOR
ENDIF
IF (<VAR.RAND> >= 7) && (<VAR.RAND> <= 16)
NAME = "Champion "+<NAME>
STR += (<STR> * 1)
STR += (<DEX> * 1)
STR += (<INT> * 1)
Allskills = (<I.Anatomy> + (<I.Anatomy> * 1))
MAXHITS += 100
HITS = MAXHITS
COLOR = colors_all
OSKIN = COLOR
ENDIF
IF (<VAR.RAND> >= 17) && (<VAR.RAND> <= 36)
NAME = "Greater "+<NAME>
STR += (<STR> * 0,5)
STR += (<DEX> * 0,5)
STR += (<INT> * 0,5)
Allskills = (<I.Anatomy> + (<I.Anatomy> * 0,5))
MAXHITS += 50
HITS = MAXHITS
COLOR = colors_all
OSKIN = COLOR
ENDIF
I put the TAG.LEVEL and TAG.NPCCLASS inside the monster chardef. Should I move them to the monster's @Create, then?
|
|
04-29-2017 12:28 PM |
|
|
gergecoelho
Apprentice
Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0
|
RE: NPC Events not being applied
Whoa those were some rookie mistakes. Corrected them and cleaned up a bit the parenthesis, but it steel doesn't seem to work. The stats aren't being applied.
Code:
[EVENTS e_NPC_Triumphus] //NPC Spawn
ON=@Create
ALLSKILLS = <EVAL 100 + <TAG.LEVEL> * 80>
IF (<TAG.NPCCLASS> == 01) //Brute
STR = <EVAL 18 + <TAG.LEVEL> * 8 + {1 3}>
DEX = <EVAL 3 + <TAG.LEVEL> * 8 + {1 3}>
INT = <EVAL -3 + <TAG.LEVEL> * 8 + {1 3}>
MAXHITS = <EVAL <STR> + 20>
HITS = <MAXHITS>
EVENTS +e_brute
ENDIF
1. I don't know if ALLSKILLS can be called in like that;
2. I've tried <TAG.NPCCLASS> == 01 and just 1, it's being defined on the Chardef block.
Any clues?
|
|
05-02-2017 02:33 AM |
|
|
gergecoelho
Apprentice
Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0
|
RE: "Rare" Spawner Event
Code:
19:58:1:'gergecoelho' commands 'add c_orc'=1
19:58:1:'Gerge' Says 'all stop' mode=0
19:58:LOL
19:58:1:'gergecoelho' commands 'serv.log LOL'=1
Server is being PAUSED for Resync
Resync Restart
Indexing 753 scripts...
WARNING:Resource 'scripts/npcs/Monsters/Orcs.scp' changed, resync.
Done loading scripts (105 of 199 triggers used)
Resync complete!
20:00:1:'gergecoelho' commands 'add c_orc'=1
20:00:1:'Gerge' Says 'all stop' mode=0
20:00:1:'gergecoelho' commands 'set show str'=1
20:00:'gergecoelho' commands uid=0401 (Rugbu) to 'show str'=1
20:01:1:'gergecoelho' commands 'remove'=1
20:01:'gergecoelho' commands uid=0401 (Rugbu) to 'remove'=1
20:01:1:'gergecoelho' commands 'remove'=1
20:01:'gergecoelho' commands uid=03fc (Romarod) to 'remove'=1
Edit: Managed to get it to work, but I need to force the event on each creature TEVENTS=e_carnivores2, e_NPC_Triumphus, etc.
The normalized spawn based on level+npcclass is working, the Rare Spawner is still not triggering, though. I'll test further. ;O
Edit2: Random Rare spawner seems to be in order! Thanks for the help! Think I'll just apply it manually, also spares me the trouble of finding a way to make this system not trigget on shopkeepers.
(This post was last modified: 05-06-2017 09:18 AM by gergecoelho.)
|
|
05-06-2017 09:10 AM |
|
|