-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Team check function #1860
base: master
Are you sure you want to change the base?
Team check function #1860
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1578,6 +1578,81 @@ MainLoop: | |
return true; | ||
}, | ||
|
||
/* | ||
Pather.TeamCheck(); | ||
Make Leader communication to others. Add by WhyY0416 | ||
*/ | ||
TeamCheck: function (phase) { | ||
var MemberCount = 0, | ||
Member = [], | ||
timeOut = 600; //How to put this in character's config ? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. something like |
||
|
||
function ChatEvent(name,msg) { | ||
if (me.name !== name){ | ||
var i, command, | ||
match = ["Ready","Finished"]; | ||
|
||
if (msg) { | ||
for (i = 0; i < match.length; i += 1) { | ||
if (msg.match(match[i])) { | ||
if(Member.indexOf(name) > -1){ | ||
continue; | ||
} | ||
else{ | ||
Member.push(name); | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
addEventListener("chatmsg", ChatEvent); | ||
|
||
if (me.area === 108){ //Diablo Script. | ||
return true; | ||
} | ||
|
||
if (MemberCount === 0){ //Except MFLeader!!! | ||
var party = getParty(); | ||
do { | ||
if (party.name !== me.name){ | ||
MemberCount += 1; | ||
} | ||
} | ||
while (party.getNext()); | ||
if (!party){ //single playermode. | ||
return true; | ||
} | ||
} | ||
|
||
if (phase === 1){ | ||
say("Position " + getArea().id); | ||
delay(1000); | ||
} | ||
|
||
|
||
MainLoop: | ||
while (timeOut > 0){ | ||
if (Member.length === MemberCount){ | ||
break MainLoop; | ||
} | ||
if (timeOut % 5 === 0){ | ||
if (phase === 1){ | ||
say("TeamCheck"); | ||
} | ||
else if (phase === 2){ | ||
say("FinishCheck"); | ||
} | ||
} | ||
timeOut -= 1; | ||
delay(1000); | ||
} | ||
Member.length = 0; | ||
return true; | ||
}, | ||
|
||
/* | ||
Pather.getAreaName(area); | ||
area - id of the area to get the name for | ||
|
@@ -1724,4 +1799,4 @@ MainLoop: | |
|
||
return areas[area]; | ||
} | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your changes are annotated in git, so your name is already on these lines as far as git is concerned. You don't need these comments with your name :)