Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
L2j Server Datapack
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
L2j
L2j Server Datapack
Commits
c9be4c81
Commit
c9be4c81
authored
9 years ago
by
Zoey76
Browse files
Options
Downloads
Plain Diff
Merge pull request #161 from luksdlt92/fix-baium
Baium AI fixed
parents
03d9a106
1717f138
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
L2J_DataPack/dist/game/data/scripts/ai/individual/Baium/Baium.java
+34
-25
34 additions, 25 deletions
...ack/dist/game/data/scripts/ai/individual/Baium/Baium.java
with
34 additions
and
25 deletions
L2J_DataPack/dist/game/data/scripts/ai/individual/Baium/Baium.java
+
34
−
25
View file @
c9be4c81
...
...
@@ -100,7 +100,6 @@ public final class Baium extends AbstractNpcAI
// Misc
private
L2GrandBossInstance
_baium
=
null
;
private
static
long
_lastAttack
=
0
;
private
static
L2PcInstance
_standbyPlayer
=
null
;
private
Baium
()
{
...
...
@@ -213,6 +212,7 @@ public final class Baium extends AbstractNpcAI
_lastAttack
=
System
.
currentTimeMillis
();
startQuestTimer
(
"WAKEUP_ACTION"
,
50
,
_baium
,
null
);
startQuestTimer
(
"MANAGE_EARTHQUAKE"
,
2000
,
_baium
,
null
);
startQuestTimer
(
"SOCIAL_ACTION"
,
10000
,
_baium
,
player
);
startQuestTimer
(
"CHECK_ATTACK"
,
60000
,
_baium
,
null
);
}
break
;
...
...
@@ -231,7 +231,6 @@ public final class Baium extends AbstractNpcAI
{
zone
.
broadcastPacket
(
new
Earthquake
(
npc
.
getX
(),
npc
.
getY
(),
npc
.
getZ
(),
40
,
10
));
zone
.
broadcastPacket
(
new
PlaySound
(
"BS02_A"
));
startQuestTimer
(
"SOCIAL_ACTION"
,
8000
,
npc
,
player
);
}
break
;
}
...
...
@@ -253,10 +252,18 @@ public final class Baium extends AbstractNpcAI
player
.
teleToLocation
(
BAIUM_GIFT_LOC
);
startQuestTimer
(
"PLAYER_KILL"
,
3000
,
npc
,
player
);
}
else
if
((
_standbyPlayer
!=
null
)
&&
_standbyPlayer
.
isInsideRadius
(
npc
,
16000
,
true
,
false
))
else
{
_standbyPlayer
.
teleToLocation
(
BAIUM_GIFT_LOC
);
startQuestTimer
(
"PLAYER_KILL"
,
3000
,
npc
,
_standbyPlayer
);
L2PcInstance
randomPlayer
=
getRandomPlayer
(
npc
);
if
(
randomPlayer
!=
null
)
{
randomPlayer
.
teleToLocation
(
BAIUM_GIFT_LOC
);
startQuestTimer
(
"PLAYER_KILL"
,
3000
,
npc
,
randomPlayer
);
}
else
{
startQuestTimer
(
"PLAYER_KILL"
,
3000
,
npc
,
null
);
}
}
}
break
;
...
...
@@ -266,20 +273,20 @@ public final class Baium extends AbstractNpcAI
if
((
player
!=
null
)
&&
player
.
isInsideRadius
(
npc
,
16000
,
true
,
false
))
{
zone
.
broadcastPacket
(
new
SocialAction
(
npc
.
getObjectId
(),
1
));
broadcastNpcSay
(
npc
,
Say2
.
NPC_ALL
,
player
.
getName
()
+
", How dare you wake me! Now you shall die!"
);
// TODO: replace with NpcStringId when are done core support
broadcastNpcSay
(
npc
,
Say2
.
NPC_ALL
,
NpcStringId
.
HOW_DARE_YOU_WAKE_ME_NOW_YOU_SHALL_DIE
,
player
.
getName
());
npc
.
setTarget
(
player
);
npc
.
doCast
(
BAIUM_PRESENT
.
getSkill
());
}
for
(
L2PcInstance
p
layer
s
:
zone
.
getPlayersInside
())
for
(
L2PcInstance
insideP
layer
:
zone
.
getPlayersInside
())
{
if
(
p
layer
s
.
isHero
())
if
(
insideP
layer
.
isHero
())
{
zone
.
broadcastPacket
(
new
ExShowScreenMessage
(
NpcStringId
.
NOT_EVEN_THE_GODS_THEMSELVES_COULD_TOUCH_ME_BUT_YOU_S1_YOU_DARE_CHALLENGE_ME_IGNORANT_MORTAL
,
2
,
4000
,
p
layer
s
.
getName
()));
zone
.
broadcastPacket
(
new
ExShowScreenMessage
(
NpcStringId
.
NOT_EVEN_THE_GODS_THEMSELVES_COULD_TOUCH_ME_BUT_YOU_S1_YOU_DARE_CHALLENGE_ME_IGNORANT_MORTAL
,
2
,
4000
,
insideP
layer
.
getName
()));
break
;
}
}
startQuestTimer
(
"SPAWN_ARCHANGEL"
,
8000
,
npc
,
null
);
startQuestTimer
(
"SPAWN_ARCHANGEL"
,
8000
,
npc
,
player
);
break
;
}
case
"SPAWN_ARCHANGEL"
:
...
...
@@ -296,19 +303,12 @@ public final class Baium extends AbstractNpcAI
{
addAttackPlayerDesire
(
npc
,
player
);
}
else
if
((
_standbyPlayer
!=
null
)
&&
!
_standbyPlayer
.
isDead
())
{
addAttackPlayerDesire
(
npc
,
_standbyPlayer
);
}
else
{
for
(
L2Character
creature
:
npc
.
getKnownList
().
getKnownCharactersInRadius
(
2000
))
L2PcInstance
randomPlayer
=
getRandomPlayer
(
npc
);
if
(
randomPlayer
!=
null
)
{
if
((
creature
!=
null
)
&&
creature
.
isPlayer
()
&&
zone
.
isInsideZone
(
creature
)
&&
!
creature
.
isDead
())
{
addAttackPlayerDesire
(
npc
,
(
L2Playable
)
creature
);
break
;
}
addAttackPlayerDesire
(
npc
,
randomPlayer
);
}
}
break
;
...
...
@@ -377,6 +377,7 @@ public final class Baium extends AbstractNpcAI
{
if
((
npc
!=
null
)
&&
((
_lastAttack
+
1800000
)
<
System
.
currentTimeMillis
()))
{
cancelQuestTimers
(
"SELECT_TARGET"
);
notifyEvent
(
"CLEAR_ZONE"
,
null
,
null
);
addSpawn
(
BAIUM_STONE
,
BAIUM_LOC
,
false
,
0
);
setStatus
(
ALIVE
);
...
...
@@ -560,6 +561,7 @@ public final class Baium extends AbstractNpcAI
startQuestTimer
(
"CLEAR_STATUS"
,
respawnTime
,
null
,
null
);
startQuestTimer
(
"CLEAR_ZONE"
,
900000
,
null
,
null
);
cancelQuestTimer
(
"CHECK_ATTACK"
,
npc
,
null
);
cancelQuestTimers
(
"SELECT_TARGET"
);
}
return
super
.
onKill
(
npc
,
killer
,
isSummon
);
}
...
...
@@ -572,11 +574,6 @@ public final class Baium extends AbstractNpcAI
return
super
.
onSeeCreature
(
npc
,
creature
,
isSummon
);
}
if
(
creature
.
isPlayer
()
&&
!
creature
.
isDead
()
&&
(
_standbyPlayer
==
null
))
{
_standbyPlayer
=
(
L2PcInstance
)
creature
;
}
if
(
creature
.
isInCategory
(
CategoryType
.
CLERIC_GROUP
))
{
if
(
npc
.
getCurrentHp
()
<
(
npc
.
getMaxHp
()
*
0.25
))
...
...
@@ -785,6 +782,18 @@ public final class Baium extends AbstractNpcAI
}
}
private
L2PcInstance
getRandomPlayer
(
L2Npc
npc
)
{
for
(
L2Character
creature
:
npc
.
getKnownList
().
getKnownCharactersInRadius
(
2000
))
{
if
((
creature
!=
null
)
&&
creature
.
isPlayer
()
&&
zone
.
isInsideZone
(
creature
)
&&
!
creature
.
isDead
())
{
return
(
L2PcInstance
)
creature
;
}
}
return
null
;
}
public
static
void
main
(
String
[]
args
)
{
new
Baium
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment